Support IHateMoney QR codes - #93
Conversation
25a839f to
ba76d31
Compare
|
Thank you very much for the extra effort, I'm happy to see it working now! Unfortunately, during testing I finally got "the too many requests error" with my own cloud (no matter your new feature changes or my previous attempts to fix #81). I'd like to look into this first before continuing reviewing and testing you changes. A bit tight on capacity right now, but I'll try my best! |
No worries, take your time! |
|
Hi @magshee and happy WWDC! I catered to two issues seemingly more severe first and gladly none of those fixes touch any file you changed, so I'll be able to review and test your code regardless of that. This is next on my list and I'm sorry it took so long, still – or even more so, I really appreciate your contribution and will try my best to merge it soon. Then it becomes time to push all the latest improvements to the AppStore. Liquid Glass will also be mandatory from Xcode 27 onwards, so that's another small exercise before getting the update out there. But also a great opportunity for some UI fixes I honestly feel more at home with. 😄 |
InteractionEngineer
left a comment
There was a problem hiding this comment.
Thank you for your patience! I am thrilled about the new functionalities, thanks for your work! I've had a look on the changes and left some comments that came to my mind – sorry, I fell back to German with those.
Regarding MoneyBuster: Unfortunately I don't have access to Android systems and assumed it must be a deep-link, like in iOS that opens within an app directly. If you see MoneyBuster works differently, please feel free to adjust our code.
One last important bit: Changing from token to projectId, or rather adding it and alter the previous token duty might / will affect historic app data. Were you able to test migration and see effects on projects added before your update? I confirmed it'll work really well with a blank database.
a7f4d83 to
0eef44d
Compare
0eef44d to
fea620e
Compare
|
Thanks for your feedback! I'll address the last comment at some point in the next days! |
I was currently testing the migration and stumbled upon a problem. I thought I had already done a successful test a few weeks ago, but this might only be with a cospend project. I'll let you know as soon as I could verify that both existing Cospend and IHM projects are sill working. It might take me a couple of days though, but thanks for your patience! |
Thanks for your endurance and I'm really glad we caught it so early! |
|
I was finally able to test the migration for both Cospend and I Hate Money Projects. I used the current state of the main branch, added a Cospend and a IHM Project and verified that both are working by adding an expense to each. I then started the "new" version from my branch, saw that the migration was successful and verified it by adding an expense to each project again. I am fairly sure, that no more problems should arise here, but feel free to test it on your side again! Sorry that this took more time than I had expected. I am glad, that I could finally give you an update here! If any new problems arise that could be caused by the migration, feel free to add me in the comments. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for iHateMoney QR codes / invite links and updates the data model so “project identifier” and “access token” are represented separately (via a new projectId field), including a storage migration and updated URL decoding.
Changes:
- Introduces
Project.projectId(and correspondingStoredProject.projectId) plus a GRDB migration to backfill legacy rows. - Refactors QR / URL decoding from tuple returns to typed
ProjectData*models, adding iHateMoney QR decoding and invite-link paste support. - Updates networking to use
projectIdin iHateMoney API paths and to support Bearer-token auth in addition to Basic auth.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| PayForMeTests/UrlExtensionsTests.swift | Updates URL decoding tests for typed project data; adds iHateMoney QR decoding coverage. |
| PayForMeTests/TestHelpers.swift | Updates test project factories to include projectId. |
| PayForMeTests/StorageMigrationTests.swift | Adds migration test for legacy iHateMoney rows (token → projectId). |
| PayForMeTests/NetworkRequestTests.swift | Updates request URL expectations to use projectId for iHateMoney paths. |
| PayForMeTests/BalanceCalculationTests.swift | Updates test project construction to include projectId. |
| PayForMe/Views/Projects/ShareProjectQRCodeViewModel.swift | Shares Cospend QR codes using projectId instead of token. |
| PayForMe/Views/Projects/QRCodes/AddProjectQRViewModel.swift | Updates QR scanning flow to handle password-based vs token-based project data. |
| PayForMe/Views/Projects/Manual/AddProjectManualViewModel.swift | Adds invite token handling and paste parsing for iHateMoney links/tokens. |
| PayForMe/Views/Projects/Manual/AddProjectManualView.swift | Updates manual add UI to support pasting links and entering invite tokens. |
| PayForMe/Util/Util.swift | Replaces tuple “ProjectData” with typed models; adds iHateMoney decoding and updated QR dispatch. |
| PayForMe/Services/StorageService.swift | Adds v4 migration and exposes migrator for tests; backfills projectId. |
| PayForMe/Services/ProjectManager.swift | Allows app-opened URLs for both Cospend and iHateMoney schemes. |
| PayForMe/Services/NetworkService.swift | Uses projectId for iHateMoney paths; adds Bearer invite-token project-name lookup. |
| PayForMe/SceneDelegate.swift | Accepts ihatemoney scheme in openURLContexts. |
| PayForMe/Model/Project.swift | Adds projectId to Project/StoredProject and updates initializers/previews. |
| PayForMe.xcodeproj/project.pbxproj | Adds StorageMigrationTests.swift to the test target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…e/PayForMe into fix/i-hate-money-qr-codes
|
Hi @magshee – awesome, thank you for your contribution! I ran the copilot review, evaluated the findings and pushed some minor improvements. It's now ready to be merged and I think we have enough fixes for an iOS update. As I wasn't the fastest myself with further (frontend) improvements, I don't want the community to have to wait any longer for all the fixes on the main branch right now. I'll take care of the publishing process and handle the past due Liquid Glass changes at the same time. |
|
Sound good! Looking forward to the new release! |
Closes #90
This required a little more work than I had expected, but I’m really happy to made progress in this PR.
Here are the changes:
PROJECT_TOKENthat can be used a as Bearer token for authentication. For some reason, the project identifier was stored in a variable called token. I decided to store the project identifier in a new field and use the token variable for the IHateMoney token.Thoughts for further consideration:
AddProjectQRViewModelwere already commented. If they are not used/required, maybe consider removing themEventually there are still things in here that can be improved, looking forward to your feedback!