Skip to content

fix: always show snackbar on 403 errors#113

Merged
v-kessler merged 2 commits intomainfrom
fix-snackbar-on-403-v2
Mar 24, 2026
Merged

fix: always show snackbar on 403 errors#113
v-kessler merged 2 commits intomainfrom
fix-snackbar-on-403-v2

Conversation

@v-kessler
Copy link
Contributor

@v-kessler v-kessler commented Mar 24, 2026

403 Forbidden errors now always display a snackbar notification so the user knows they lack permission. Previously, 403 errors were silently suppressed unless the caller explicitly passed notify=true.

404 errors remain silently handled by the UI (router redirect, v-alert) unless notify=true is explicitly passed.

This re-applies the fix from #112 (which was merged before CI completed and then reverted).

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Forbidden access errors (HTTP 403) now display error notifications to users instead of being silently ignored, improving transparency and user feedback.

403 Forbidden errors now always display a snackbar notification so the
user knows they lack permission. Previously, 403 errors were silently
suppressed unless the caller explicitly passed notify=true.

404 errors remain silently handled by the UI (router redirect, v-alert)
unless notify=true is explicitly passed.
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@v-kessler has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d18c8398-5ab6-48f7-b43d-d4c5f8408551

📥 Commits

Reviewing files that changed from the base of the PR and between 83dbf04 and 1a832e9.

📒 Files selected for processing (1)
  • src/plugins/functions.ts

Walkthrough

Updated the handleError function to remove HTTP 403 (forbidden) errors from the early-return path, allowing them to proceed through the standard error-handling flow including snackbar notifications controlled by setError, instead of silently suppressing them.

Changes

Cohort / File(s) Summary
Error Handling Logic
src/plugins/functions.ts
Modified handleError early-return condition from (isForbiddenError(error) || isNotFoundError(error)) to isNotFoundError(error) only, ensuring 403 errors trigger snackbar notifications per the setError behavior rather than exiting silently.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • fix: error snackbar on 403 #112: Modifies the same handleError function in src/plugins/functions.ts to change 403 error suppression behavior for snackbar notifications.

Poem

🐰 A forbidding error once hid in the shade,
Now it speaks up with a snackbar parade!
Four-oh-three shall not slip away,
The rabbit fixed it—hooray, hooray! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: always show snackbar on 403 errors' is fully related to the main change in the pull request, which updates error handling to ensure 403 forbidden errors display a snackbar notification instead of being silently suppressed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-snackbar-on-403-v2

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.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/plugins/functions.ts (1)

193-196: Add regression tests for 403/404 notification matrix.

Please add focused tests for handleError/setError covering: 403 + notify undefined/false (snackbar shown), 404 + notify false (silent), and 404 + notify true (snackbar shown).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/plugins/functions.ts` around lines 193 - 196, Add unit tests for the
error-notification matrix targeting the functions handleError and setError:
create three focused tests that assert snackbar notification behavior when (1) a
403 error occurs and notify is undefined/false -> snackbar shown, (2) a 404
error occurs and notify is false -> no snackbar, and (3) a 404 error occurs and
notify is true -> snackbar shown. In each test, simulate the error payload (use
a Response-like object or helper that triggers isNotFoundError for 404 and a 403
for forbidden), call handleError/setError with the appropriate notify value, and
assert that the notification/snackbar stub or mock was invoked or not
accordingly; reference the isNotFoundError predicate to ensure you supply the
right error shape and stub the notification mechanism used by the code under
test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/plugins/functions.ts`:
- Around line 193-196: Add unit tests for the error-notification matrix
targeting the functions handleError and setError: create three focused tests
that assert snackbar notification behavior when (1) a 403 error occurs and
notify is undefined/false -> snackbar shown, (2) a 404 error occurs and notify
is false -> no snackbar, and (3) a 404 error occurs and notify is true ->
snackbar shown. In each test, simulate the error payload (use a Response-like
object or helper that triggers isNotFoundError for 404 and a 403 for forbidden),
call handleError/setError with the appropriate notify value, and assert that the
notification/snackbar stub or mock was invoked or not accordingly; reference the
isNotFoundError predicate to ensure you supply the right error shape and stub
the notification mechanism used by the code under test.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0f1d76c1-ce4c-4793-8951-bab4ddb0a3f6

📥 Commits

Reviewing files that changed from the base of the PR and between f6b00d6 and 83dbf04.

📒 Files selected for processing (1)
  • src/plugins/functions.ts

@v-kessler v-kessler merged commit 47e6994 into main Mar 24, 2026
5 checks passed
@v-kessler v-kessler deleted the fix-snackbar-on-403-v2 branch March 24, 2026 16:38
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