Skip to content

attempt to fix #81#92

Merged
InteractionEngineer merged 3 commits into
mainfrom
fix/too-many-requests
May 14, 2026
Merged

attempt to fix #81#92
InteractionEngineer merged 3 commits into
mainfrom
fix/too-many-requests

Conversation

@InteractionEngineer
Copy link
Copy Markdown
Owner

I tried working with debug logs and see where events do fire and what may cause too many events to fire but as I never had the problems myself, e.g mentioned in julien-nc/cospend-nc#258, and to date no one offered to help out with a setup that error can be reproduced with, it's a hopeful try. Until another occurence, this merge closes #81.

…ojects

validatedInput and validatedServer were computed vars, causing 3 independent Combine chains and 2 network requests per debounce cycle. Converting them to lazy stored properties with .share() reduces this to 1 request. Also bumped password debounce from 0.5s to 1s and added .removeDuplicates() to the QR scanner publisher.
Copilot AI review requested due to automatic review settings May 14, 2026 19:21
Copy link
Copy Markdown
Contributor

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 PR attempts to reduce duplicate validation/scanning events that may contribute to excessive requests when adding projects manually or via QR code.

Changes:

  • Debounces QR password validation for longer and removes a debug log.
  • Suppresses duplicate scanned QR URLs.
  • Shares manual validation publishers and limits server validation concurrency.

Reviewed changes

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

File Description
PayForMe/Views/Projects/QRCodes/AddProjectQRViewModel.swift Adjusts QR/password validation event handling.
PayForMe/Views/Projects/Manual/AddProjectManualViewModel.swift Refactors manual validation publishers to reduce duplicate requests.

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

Comment thread PayForMe/Views/Projects/QRCodes/AddProjectQRViewModel.swift Outdated
Comment thread PayForMe/Views/Projects/Manual/AddProjectManualViewModel.swift Outdated
…lViewModel

Replace flatMap(maxPublishers: .max(1)) with map + switchToLatest() so
that when a new project input arrives, the previous in-flight validation
is abandoned and its result is never delivered downstream. Move
lastProjectTestedSuccessfully assignment into handleEvents after
switchToLatest so stale async completions cannot enable the Add button
with outdated data.

Agent-Logs-Url: https://github.com/InteractionEngineer/PayForMe/sessions/6439287b-270d-45c7-b76d-2544c0f0689c

Co-authored-by: InteractionEngineer <56229275+InteractionEngineer@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@InteractionEngineer InteractionEngineer merged commit ee9596a into main May 14, 2026
1 check passed
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.

PayForMe Causes HTTP-Error 429: Too Many Requests

3 participants