Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing jwt signer regression #320

Merged
merged 1 commit into from
Mar 8, 2025
Merged

fixing jwt signer regression #320

merged 1 commit into from
Mar 8, 2025

Conversation

pellicceama
Copy link
Collaborator

@pellicceama pellicceama commented Mar 8, 2025

Important

Fixes JWT signing regression in createMagicLink mutation by adding async and adjusts clipboard behavior in MagicLinkPage.

  • Behavior:
    • Fixes JWT signing regression in createMagicLink mutation in customerRouter.ts by adding async to ensure proper token generation.
    • Adjusts MagicLinkPage in page.tsx to copy magic link to clipboard before redirecting if isMainPreview is true.
  • Misc:
    • Minor code reformatting in customerRouter.ts for better readability.

This description was created by Ellipsis for bd3fc2c. It will automatically update as commits are pushed.

Copy link

vercel bot commented Mar 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openint ❌ Failed (Inspect) Mar 8, 2025 8:31pm

Copy link

recurseml bot commented Mar 8, 2025

✨ No issues found! Your code is sparkling clean! ✨

🗒️ View all ignored comments in this repo
  • This export statement is redundant as it appears both in the diff and original source code. Adding it again will cause a duplicate export error. The line should be removed since it already exists in the source code.

@pellicceama pellicceama merged commit 27bf369 into main Mar 8, 2025
4 of 5 checks passed
@pellicceama pellicceama deleted the stably-improvs branch March 8, 2025 20:30
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to bd3fc2c in 1 minute and 15 seconds

More details
  • Looked at 96 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. apps/web/app/dashboard/(authenticated)/connect/page.tsx:147
  • Draft comment:
    Consider that copying the URL to the clipboard before redirecting in main preview mode may be redundant, since the user never sees the copied content if they’re redirected immediately.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50%
    The comment makes a valid point about efficiency - copying to clipboard right before a redirect is wasteful. However, this is a very minor optimization that doesn't affect functionality. The current code works fine either way. The suggestion also changes the behavior in a subtle way - currently the URL is always copied regardless of preview mode.
    The current behavior of always copying might be intentional for consistency or for cases where the redirect fails. The optimization is so minor it may not be worth changing the code.
    While the comment is technically correct, this kind of micro-optimization doesn't provide enough value to justify a code change and potential behavior change.
    The comment should be removed as it suggests an unnecessary optimization that could subtly change behavior for minimal benefit.
2. packages/engine-backend/router/customerRouter.ts:200
  • Draft comment:
    Switching to an async mutation with await for token signing is good, but ensure that downstream code correctly handles async errors.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 20% <= threshold 50%
    The comment is asking the author to ensure that downstream code handles async errors correctly. This falls under the rule of not asking the author to ensure behavior is intended or tested. The comment does not provide a specific suggestion or point out a specific issue, making it more of a general reminder.
3. packages/engine-backend/router/customerRouter.ts:201
  • Draft comment:
    Good use of 'await' with ctx.jwt.signViewer to fix the async JWT signing regression. Ensure that any dependencies relying on synchronous behavior are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
4. apps/web/app/dashboard/(authenticated)/connect/page.tsx:72
  • Draft comment:
    Minor typographical issue: In the display name for the customer (line 72), there's an extra trailing space in 'Customer Display Name '. Consider removing the trailing space for consistency.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
5. packages/engine-backend/router/customerRouter.ts:24
  • Draft comment:
    Typographical error: In the comment on line 24, "we dont' need it" should be changed to "we don't need it".
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_SbDpBwn5ePTkeuFv


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@@ -145,10 +145,10 @@ export default function MagicLinkPage() {
onSubmit={({formData: values}) => {
createMagicLink.mutate(values, {
onSuccess: async (data) => {
await copyToClipboard(data.url)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider wrapping the call to copyToClipboard in a try/catch block to ensure that a clipboard failure doesn't prevent subsequent redirection and toast display. This is especially useful since in isMainPreview mode, a failure here might block the intended redirection.

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