Skip to content

feat(auth): add hint for missing EOO_TOKEN on 401 errors - #169

Merged
axelmarciano merged 1 commit into
mainfrom
compat/v2-migration-eoo-hints
Aug 19, 2026
Merged

feat(auth): add hint for missing EOO_TOKEN on 401 errors#169
axelmarciano merged 1 commit into
mainfrom
compat/v2-migration-eoo-hints

Conversation

@axelmarciano

@axelmarciano axelmarciano commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

This pull request enhances error handling and user guidance when authentication failures occur during asset upload URL requests. It adds logic to provide helpful hints to users about token requirements and includes new tests to ensure correct behavior in various authentication scenarios.

Error handling and user guidance improvements:

  • apps/eoas/src/lib/auth.ts: Added the missingEooTokenHint function, which appends a hint to error messages when a 401 Unauthorized response is received and the server expects a different authentication token (EOO_TOKEN).
  • apps/eoas/src/lib/assets.ts: Updated the requestUploadUrls function to include the hint from missingEooTokenHint in error messages when appropriate. [1] [2]

Testing enhancements:

  • apps/eoas/src/lib/__tests__/assets.test.ts: Added a new test suite for authentication failures, covering scenarios for missing tokens, use of the wrong token, and different HTTP status codes to ensure the hint is only provided when relevant. [1] [2]

Summary by CodeRabbit

  • Bug Fixes
    • Improved upload error messages for authentication failures.
    • When Expo credentials are missing or invalid, errors now provide guidance about the required dashboard token.
    • Guidance is limited to relevant unauthorized responses and is omitted when a dashboard token is already available or for other failure types.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28e01067-a02c-44ca-b5c8-7d4149f3999e

📥 Commits

Reviewing files that changed from the base of the PR and between a47a4a6 and df49068.

📒 Files selected for processing (3)
  • apps/eoas/src/lib/__tests__/assets.test.ts
  • apps/eoas/src/lib/assets.ts
  • apps/eoas/src/lib/auth.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds conditional dashboard-token guidance to upload URL authentication errors. The guidance applies to Expo-mode 401 responses. Tests cover token presence, dashboard authentication, non-401 failures, and environment cleanup.

Changes

Upload authentication hint

Layer / File(s) Summary
Conditional authentication hint
apps/eoas/src/lib/auth.ts
Adds missingEooTokenHint, which returns guidance for Expo-mode 401 responses and no hint for other cases.
Upload error integration and validation
apps/eoas/src/lib/assets.ts, apps/eoas/src/lib/__tests__/assets.test.ts
Appends the conditional hint to failed upload URL requests. Tests validate Expo credentials, dashboard tokens, non-401 failures, and cleanup.

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

Merge Risk: ⚪ Minimal · up to df490

This localized change improves guidance for authentication failures without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the new authentication hint for missing EOO_TOKEN values on 401 errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch compat/v2-migration-eoo-hints

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.

@axelmarciano
axelmarciano merged commit ba2ee27 into main Aug 19, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in expo-open-ota Aug 19, 2026
@axelmarciano
axelmarciano deleted the compat/v2-migration-eoo-hints branch August 19, 2026 08:11
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.

Docs: v2→v3 migration guide doesn't mention EOO_TOKEN is required for publishing in dashboard mode

1 participant