Turn off A2 actor sync in AT22 - #2222
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR extends the ChangesDelayed Cookie Listener Response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR disables routing “change reportee” via Altinn 2 (A2) in the AT22 and Development environments to support testing decoupling from A2. It also adds an optional delay to the cookie-change listener to reduce the chance of showing the reload modal in the same tab immediately after changing actor.
Changes:
- Added
delayResponsesupport to theuseCookieListenerhook and used it for the AltinnPartyId reload alert. - Disabled
RouteChangeReporteeViaAltinn2inappsettings.Development.jsonandappsettings.AT22.json.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/resources/Cookie/CookieMethods.ts | Adds delayed cookie-change signaling to useCookieListener. |
| src/components/ReloadAlert/ReloadAlert.tsx | Uses the new useCookieListener delay to defer showing the reload dialog. |
| backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/appsettings.Development.json | Turns off Altinn 2 reportee-routing feature flag in Development. |
| backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/appsettings.AT22.json | Turns off Altinn 2 reportee-routing feature flag in AT22. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/resources/Cookie/CookieMethods.ts`:
- Around line 35-40: The polling effect creates a new delayed timeout each time
the cookie differs but only clears the interval, causing accumulation of pending
timers; fix by storing the timeout id (from setTimeout) in a variable (e.g.,
timeoutId) scoped inside the effect, only scheduling a new setTimeout when
timeoutId is null/undefined, and calling clearTimeout(timeoutId) whenever the
cookie matches again or in the effect cleanup; ensure you still
clearInterval(checkCookie) and also null out the timeoutId after clearing so
subsequent polls can schedule correctly (refer to setTimeout, clearTimeout,
setCookieChanged and checkCookie).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 02982bc4-4476-474c-acbe-ab3af4346ac8
📒 Files selected for processing (4)
backend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/appsettings.AT22.jsonbackend/src/Altinn.AccessManagement.UI/Altinn.AccessManagement.UI/appsettings.Development.jsonsrc/components/ReloadAlert/ReloadAlert.tsxsrc/resources/Cookie/CookieMethods.ts
|
TheTechArch
left a comment
There was a problem hiding this comment.
Ode to the Decoupling (PR #2222)
In AT22 the flag was flipped,
The Altinn 2 sync, at last, unzipped.
No more shall actors cross that bridge—
We've cut the cord at the ridge.
The cookie listener, once too keen,
Would flash a modal on the screen.
"Reload! Reload!" it'd cry and shout,
Before the tab had figured out
That it had changed the actor's name—
The current tab was not to blame.
A gentle delay, a breath, a pause,
Now guards against that jarring cause.
A moment's grace before the bell,
So the same tab can change and tell
Its own cookies, "Yes, that's me—
No need to scream. I hold the key."
Two-two-two-two, the PR number gleams,
A tidy cut of tangled seams.
Old Altinn loosens one more thread,
And dev moves on to what's ahead.



Description
To test decoupling from A2, we turn off the actor syncing to A2 in AT22 (and dev)
Also: Added optional delay to cookie listener hook to minimize risk of the "reload modal" appearing in the current tab when changing the actor in that same tab.
Verification
Documentation
Summary by CodeRabbit
Configuration Updates
Improvements