Skip to content

fix: log referral completion errors - #81

Merged
thomasluizon merged 2 commits into
mainfrom
fix/referral-error-logging
Mar 28, 2026
Merged

fix: log referral completion errors#81
thomasluizon merged 2 commits into
mainfrom
fix/referral-error-logging

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • Replace silent catch in LogHabitCommand with error logging for referral completion failures
  • Helps diagnose why referral completion is silently failing in production

Test Plan

  • Deploy and trigger referral completion -- check Render logs for errors

🤖 Generated with Claude Code

thomasluizon and others added 2 commits March 28, 2026 14:29
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Referrer gets "Referral Completed!" / "Indicacao Concluida!" notification
- Referred user gets "You earned a coupon!" / "Voce ganhou um cupom!" notification
- Both users now receive a 10% discount coupon (previously only referrer)
- Notifications use user's language preference (en/pt-BR)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit fbda79e into main Mar 28, 2026
2 checks passed
@thomasluizon
thomasluizon deleted the fix/referral-error-logging branch March 28, 2026 17:33
thomasluizon added a commit that referenced this pull request Jun 4, 2026
The auth rate-limit (5/min, partitioned by user) is shared across every
step-up and verify call. StepUpVerify_ExceedsAuthRateLimit deliberately
exhausts it, and as a sibling of the other pending-ops tests on the same
class-wide account that bled 429s into them whenever they shared a
clock-minute. Move it into a dedicated nested RateLimitTests class with
its own IAsyncLifetime and its own registered account so the exhausted
bucket is isolated. Shared seeding helpers become static and parameterized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 5, 2026
Add PendingOperationsControllerTests driving the full agent confirmation
flow over real HTTP against Postgres: confirm -> step-up -> step-up/verify
-> execute, anchored on the api_keys.manage (StepUp) capability.

Adds a capturing IEmailService fake (CapturingEmailService) to the test
factory via ConfigureTestServices so the step-up code (emailed only) is
readable by the test. Asserts confirmation-token persistence, step-up
challenge issuance + 60s service cooldown, valid/invalid code verification,
the auth rate limiter on repeated verifies, execute-time step_up_required
enforcement, and the full happy path creating a real API key.

Refs thomasluizon/orbit-ui-mobile#81

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 5, 2026
The auth rate-limit (5/min, partitioned by user) is shared across every
step-up and verify call. StepUpVerify_ExceedsAuthRateLimit deliberately
exhausts it, and as a sibling of the other pending-ops tests on the same
class-wide account that bled 429s into them whenever they shared a
clock-minute. Move it into a dedicated nested RateLimitTests class with
its own IAsyncLifetime and its own registered account so the exhausted
bucket is isolated. Shared seeding helpers become static and parameterized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 5, 2026
…) (#178)

* test(api): HTTP integration tests for pending-operations endpoints (#81)

Add PendingOperationsControllerTests driving the full agent confirmation
flow over real HTTP against Postgres: confirm -> step-up -> step-up/verify
-> execute, anchored on the api_keys.manage (StepUp) capability.

Adds a capturing IEmailService fake (CapturingEmailService) to the test
factory via ConfigureTestServices so the step-up code (emailed only) is
readable by the test. Asserts confirmation-token persistence, step-up
challenge issuance + 60s service cooldown, valid/invalid code verification,
the auth rate limiter on repeated verifies, execute-time step_up_required
enforcement, and the full happy path creating a real API key.

Refs thomasluizon/orbit-ui-mobile#81

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(api): isolate step-up rate-limit test to its own user (#81)

The auth rate-limit (5/min, partitioned by user) is shared across every
step-up and verify call. StepUpVerify_ExceedsAuthRateLimit deliberately
exhausts it, and as a sibling of the other pending-ops tests on the same
class-wide account that bled 429s into them whenever they shared a
clock-minute. Move it into a dedicated nested RateLimitTests class with
its own IAsyncLifetime and its own registered account so the exhausted
bucket is isolated. Shared seeding helpers become static and parameterized.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant