Skip to content

feat(auth): RQ-6634 trigger the 24h BrowserStack data backstop on app load - #131

Open
Kanishkrawatt wants to merge 1 commit into
masterfrom
RQ-6634-24h-fresh-fetch-fallback
Open

Kanishkrawatt wants to merge 1 commit into
masterfrom
RQ-6634-24h-fresh-fetch-fallback

Conversation

@Kanishkrawatt

@Kanishkrawatt Kanishkrawatt commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Why

RQ-6634 / RCA-1328: BrowserStack sync events can be missed silently, so each product needs a 24h fresh-fetch backstop for userinfo, groupinfo and subscription-info.

What

For BrowserStack-linked users (userData.browserstackId), AuthHandler's non-blocking operations now call the callable users-refreshBrowserstackData. The backend (requestly-cloud PR) re-pulls the user's data only when it is older than 24h. The existing Firestore doc listeners pick up any change.

The call is fire-and-forget. A failure is logged and never blocks app load.

Before merge

  • Deploy the requestly-cloud function first. If this ships before the function exists, the call fails, and the app only logs the error.

Tests

  • Prettier check passes on the changed file.
  • Not type-checked or run locally (the clone has no installed packages). Not tested against a live environment yet.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • BrowserStack data is refreshed during background account operations for users with a linked BrowserStack account.
  • Bug Fixes
    • A problem refreshing BrowserStack data no longer interrupts other account operations.

… load

For BrowserStack-linked users, call `users-refreshBrowserstackData` (requestly-cloud)
from the non-blocking auth operations. The backend re-pulls user / group /
subscription data only when it is older than 24h; the existing doc listeners
pick up any change. Fire-and-forget: a failure is logged and never blocks load.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: requestly/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: bf0f59c1-f5bc-4020-8b9b-7b0cf6defe3b
📥 Commits

Reviewing files that changed from the base of the PR and between 6209537 and e8e70c4.

📒 Files selected for processing: 1
  • app/src/hooks/AuthHandler.ts

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

AuthHandler now requests a BrowserStack data refresh for users with a browserstackId. It logs refresh failures without interrupting the remaining non-blocking operations.

Changes: BrowserStack data refresh

Layer / File(s) Summary
Conditional refresh request
app/src/hooks/AuthHandler.ts
AuthHandler creates the users-refreshBrowserstackData callable and invokes it when fetched user data includes a browserstackId. Rejections are logged, and the callable is added to the callback dependency list.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: nafees87n

Merge Risk: ⚪ Minimal · up to e8e70

The BrowserStack refresh runs without blocking app load; if its separately deployed callable is unavailable, the refresh is skipped. The evidence does not show that deployment is out of sync.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly identifies the authentication change and the 24-hour BrowserStack data backstop triggered during app load.
Description check Passed The description explains the reason, implementation, dependency on the backend function, failure behavior, testing status, and related issue. It does not use all template headings and does not explici…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/src/hooks/AuthHandler.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

A rabbit checks the data flow,
A BrowserStack refresh starts to go.
If errors hop along the way,
The other tasks continue their play.
The callback keeps its links in view.

Comment @coderabbitai help to get the list of available commands.

@Kanishkrawatt
Kanishkrawatt marked this pull request as ready for review October 15, 2026 06:48
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