Skip to content

Support IHateMoney QR codes#93

Open
magshee wants to merge 1 commit into
InteractionEngineer:mainfrom
magshee:fix/i-hate-money-qr-codes
Open

Support IHateMoney QR codes#93
magshee wants to merge 1 commit into
InteractionEngineer:mainfrom
magshee:fix/i-hate-money-qr-codes

Conversation

@magshee

@magshee magshee commented May 28, 2026

Copy link
Copy Markdown
Contributor

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:

  • IHateMoney QR codes contain a PROJECT_TOKEN that 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.
  • I wanted to keep the existing functionality of adding a IHateMoneyProject via project identifier and password. And since Cospend QR codes also still provide these information instead of a project token, I chose to replace the usage of Tupels with actual data types that differ, depending on whether password or access token was used.
  • IHM projects can also be added by pasting the invite link via paste button

Thoughts for further consideration:

  • Some blocks of code (i.e. in AddProjectQRViewModel were already commented. If they are not used/required, maybe consider removing them
  • What is missing is the possibility to create a QR to share a IHateMoney project. This is currently only supported for Cospend projects.
  • Do you have any idea, what a MoneyBuster string is? I opened MoneyBuster and shared a project, and got a regular (not masked) project link

Eventually there are still things in here that can be improved, looking forward to your feedback!

@magshee magshee force-pushed the fix/i-hate-money-qr-codes branch from 25a839f to ba76d31 Compare May 28, 2026 12:15
@InteractionEngineer InteractionEngineer self-requested a review May 29, 2026 10:17
@InteractionEngineer

Copy link
Copy Markdown
Owner

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!

@magshee

magshee commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

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!
Let me know when i should update my branch. The PR #94 already looks promising. I hope you finally got it fixed!

@InteractionEngineer

Copy link
Copy Markdown
Owner

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. 😄

return Project(name: apiProject.name, password: "", token: invite.token, backend: ProjectBackend.iHateMoney, url: URL(string: invite.url)!, projectId: apiProject.id)
}

func fetchInvite(_ invite: InviteData?) async throws {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Methode erzeugt nur einen Log, sinnvoll im Produktivcode?

Comment thread PayForMe/Util/Util.swift
}

extension URL {
func decodeIHateMoenyString() -> ProjectDataWithToken? {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Tippfehler bei Money lieber frühzeitig korrigieren

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Und, falls Funktion erhalten bleiben soll, host mit let anstatt var? :)

@@ -44,11 +44,7 @@ class ProjectManager: ObservableObject {

func openedByURL(url: URL) {
let data = url.decodeCospendString()

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Gehört hier dann noch der Fall für IHM hin? decodeIHateMoneyString()

self.isTestingSubject.send(.failure)
}
}
// NetworkService.shared.testProject(project)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ich denke auch, der kommentierte Code darf bei dieser Gelegenheit gerne raus.

Comment thread PayForMe/Util/Util.swift

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Die drei extension URL Blöcke könnten zusammengefasst werden und die expliziten elementweisen Initialisierungen für ProjectDataWithToken / ProjectDataWithPassword dürften automatisch durch den Compiler generiert werden

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Viele Tests enden erfolgreich, werden aber ggf. mit if let still übersprungen. Was war der Gedanke dahinter? Das scheint mir die Effektivität der jew. Tests zu mindern. Wie wäre XCTUnwrap?

func testDecodeQRCode_httpsSchemeRoutesToMoneyBusterDecoder() tested den decoder nun nicht mehr, sondern ruft direkt die IHM decode Funktion auf (und dafür gibt es schon einen Test).

@InteractionEngineer InteractionEngineer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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.

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.

IHateMoney QR Codes

2 participants