feat: Handle v2 in downloadFileUrl#248
Merged
LouisCAD merged 2 commits intoprotected/v2from Mar 4, 2026
Merged
Conversation
936376e to
5c4ca14
Compare
There was a problem hiding this comment.
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.
STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SharedApiUrlCreator.kt
Show resolved
Hide resolved
...monMain/kotlin/com/infomaniak/multiplatform_swisstransfer/network/utils/SharedApiV2Routes.kt
Show resolved
Hide resolved
STCore/src/commonMain/kotlin/com/infomaniak/multiplatform_swisstransfer/SharedApiUrlCreator.kt
Show resolved
Hide resolved
4ea3e40 to
88e87ed
Compare
5c4ca14 to
cdc2c56
Compare
88e87ed to
3723bab
Compare
cdc2c56 to
5da5832
Compare
3723bab to
d2ca65c
Compare
5da5832 to
b34fd6d
Compare
d2ca65c to
b1619b2
Compare
b34fd6d to
ab60ee9
Compare
b1619b2 to
cc8da65
Compare
47b70fd to
276cfc4
Compare
cc8da65 to
342e723
Compare
276cfc4 to
a1cac7a
Compare
342e723 to
b6f1325
Compare
a1cac7a to
33d4e4c
Compare
b6f1325 to
28ebc5e
Compare
33d4e4c to
2de31d0
Compare
28ebc5e to
40f7415
Compare
2de31d0 to
b3c53e2
Compare
40f7415 to
de069da
Compare
eb430c0 to
d1548c9
Compare
de069da to
167348a
Compare
d1548c9 to
81d67f3
Compare
167348a to
5752b32
Compare
81d67f3 to
65ba20f
Compare
5752b32 to
2af1460
Compare
65ba20f to
2fe988c
Compare
2af1460 to
c9fc560
Compare
2fe988c to
c7aed68
Compare
c9fc560 to
8c028c2
Compare
c7aed68 to
48c7b72
Compare
8c028c2 to
e802eec
Compare
48c7b72 to
f6ff856
Compare
e802eec to
b662fd7
Compare
f6ff856 to
546775d
Compare
b662fd7 to
c4e862a
Compare
546775d to
b30af04
Compare
|
sirambd
approved these changes
Mar 4, 2026
LouisCAD
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.