Skip to content

Comments

chore: reduce uncaught errors in prod#1229

Merged
ghostdevv merged 1 commit intomainfrom
jg/various-fixlings
Feb 8, 2026
Merged

chore: reduce uncaught errors in prod#1229
ghostdevv merged 1 commit intomainfrom
jg/various-fixlings

Conversation

@43081j
Copy link
Contributor

@43081j 43081j commented Feb 8, 2026

This adds a couple of minor fixes for reducing errors we're seeing in
production:

  • Sessions can be {}, in which case, our types are incorrect
  • When a module imports a built-in, the docs resolver tries to load it
    from esm.sh
  • Use URL.parse instead of a try/catch

This adds a couple of minor fixes for reducing errors we're seeing in
production:

- Sessions can be `{}`, in which case, our types are incorrect
- When a module imports a built-in, the docs resolver tries to load it
  from `esm.sh`
- Use `URL.parse` instead of a try/catch
@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 8, 2026 6:43pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 8, 2026 6:43pm
npmx-lunaria Ignored Ignored Feb 8, 2026 6:43pm

Request Review

@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

📝 Walkthrough

Walkthrough

The pull request contains three related changes to OAuth session handling and module resolution. In server/utils/atproto/oauth.ts, a guard is added to check for the presence of currentSession.public.did before proceeding with session restoration; if absent, the function returns early with undefined oauthSession. In server/utils/docs/client.ts, URL construction is refactored from exception-based to null-check-based error handling, and bare specifier resolution is expanded to exclude builtin modules. The shared/types/userSession.ts file updates the UserServerSession interface to make the public, oauthSession, and oauthState properties optional.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description accurately describes the changeset, covering all three main fixes: session type corrections, built-in module handling, and URL.parse usage.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jg/various-fixlings

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

Copy link
Contributor

@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.

Actionable comments posted: 1


const currentSession = serverSession.data
if (!currentSession) return { oauthSession: undefined, serverSession }
// TODO (jg): why can a session be `{}`?
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the TODO or track it outside the code.
This comment doesn’t explain complex logic and should be moved to an issue tracker or removed.

As per coding guidelines, "Add comments only to explain complex logic or non-obvious implementations".

pds: string
avatar?: string
}
| undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

?: ... | undefined 😔

@ghostdevv ghostdevv added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit c6d9d3c Feb 8, 2026
20 checks passed
@ghostdevv ghostdevv deleted the jg/various-fixlings branch February 8, 2026 18:58
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.

3 participants