Skip to content

feat: Handle v2 in downloadFileUrl#248

Merged
LouisCAD merged 2 commits intoprotected/v2from
feat/download-v2
Mar 4, 2026
Merged

feat: Handle v2 in downloadFileUrl#248
LouisCAD merged 2 commits intoprotected/v2from
feat/download-v2

Conversation

@PhilippeWeidmann
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for V2 API file downloads in the SwissTransfer application. The changes implement a dual-database lookup strategy where V2 transfers (stored in Room) are checked first, before falling back to V1 transfers (stored in Realm).

Changes:

  • Added V2 file download URL construction in SharedApiV2Routes
  • Enhanced TransferUi with an apiSource enum to track API version (V1 or V2)
  • Added database query methods to support V2 file and transfer lookups

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
STNetwork/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/utils/SharedApiV2Routes.kt Added downloadFile method to construct V2 download URLs with redirect parameter
STDatabase/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/database/dao/TransferDao.kt Added getTransfer and getFile suspend methods for one-time queries
STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/mappers/TransferMapper.kt Added apiSource import and set V2 source in mapper
STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SwissTransferInjection.kt Added appDatabase parameter to SharedApiUrlCreator initialization
STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SharedApiUrlCreator.kt Implemented V2-first lookup in downloadFileUrl with Room database fallback to Realm
STCommon/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/common/interfaces/ui/TransferUi.kt Added ApiSource enum and made it a required parameter in TransferUi data class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch 3 times, most recently from 4ea3e40 to 88e87ed Compare February 26, 2026 14:56
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/download-v2 branch 2 times, most recently from 47b70fd to 276cfc4 Compare February 27, 2026 15:07
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 342e723 to b6f1325 Compare March 2, 2026 06:38
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from b6f1325 to 28ebc5e Compare March 3, 2026 07:08
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 28ebc5e to 40f7415 Compare March 3, 2026 08:52
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 40f7415 to de069da Compare March 3, 2026 09:13
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/download-v2 branch 2 times, most recently from eb430c0 to d1548c9 Compare March 3, 2026 09:17
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from de069da to 167348a Compare March 3, 2026 10:02
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 167348a to 5752b32 Compare March 3, 2026 11:47
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 5752b32 to 2af1460 Compare March 3, 2026 12:00
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 2af1460 to c9fc560 Compare March 3, 2026 15:50
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from c9fc560 to 8c028c2 Compare March 4, 2026 06:49
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from 8c028c2 to e802eec Compare March 4, 2026 08:38
@PhilippeWeidmann PhilippeWeidmann force-pushed the feat/fetch-transfer-v2 branch from e802eec to b662fd7 Compare March 4, 2026 10:34
@sirambd sirambd force-pushed the feat/fetch-transfer-v2 branch from b662fd7 to c4e862a Compare March 4, 2026 14:22
Base automatically changed from feat/fetch-transfer-v2 to protected/v2 March 4, 2026 14:49
@sirambd sirambd force-pushed the feat/download-v2 branch from 546775d to b30af04 Compare March 4, 2026 14:53
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@LouisCAD LouisCAD merged commit daa98fd into protected/v2 Mar 4, 2026
6 checks passed
@LouisCAD LouisCAD deleted the feat/download-v2 branch March 4, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants