Skip to content

v1.4.7#264

Merged
devakesu merged 7 commits intomainfrom
1.4.7
Feb 6, 2026
Merged

v1.4.7#264
devakesu merged 7 commits intomainfrom
1.4.7

Conversation

@devakesu
Copy link
Owner

@devakesu devakesu commented Feb 5, 2026

chore: update dependencies and improve error handling

  • Updated package dependencies in package.json:

  • Upgraded @redocly/cli from ^1.31.0 to 2.15.1

  • Upgraded jsdom from ^27.4.0 to 28.0.0

  • Added glob as a dependency with version ^13.0.1

  • Added node-domexception as a dependency with version ^2.0.2

  • Added source-map as a dependency with version ^0.8.0-beta.0

  • Increased timeout for authentication service requests from 5s to 15s in save-token route to handle slow backends and network latency.

  • Enhanced error handling for connection issues in save-token route, logging specific error codes and providing user-friendly messages.

  • Added conditional service worker registration in development mode based on ENABLE_SW_IN_DEV environment variable.

  • Improved session management in Supabase middleware by clearing invalid session cookies when token refresh fails and logging the error.

- Updated package dependencies in package.json:
  - Upgraded @redocly/cli from ^1.31.0 to 2.15.1
  - Upgraded jsdom from ^27.4.0 to 28.0.0
  - Added glob as a dependency with version ^13.0.1
  - Added node-domexception as a dependency with version ^2.0.2
  - Added source-map as a dependency with version ^0.8.0-beta.0

- Increased timeout for authentication service requests from 5s to 15s in save-token route to handle slow backends and network latency.
- Enhanced error handling for connection issues in save-token route, logging specific error codes and providing user-friendly messages.
- Added conditional service worker registration in development mode based on ENABLE_SW_IN_DEV environment variable.
- Improved session management in Supabase middleware by clearing invalid session cookies when token refresh fails and logging the error.
Copilot AI review requested due to automatic review settings February 5, 2026 20:00
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/app/api/auth/save-token/route.ts 0.00% 7 Missing ⚠️
src/components/sw-register.tsx 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request bumps the version to 1.4.7 and makes several improvements to dependency management, error handling, and development experience.

Changes:

  • Updated multiple npm dependencies including major version upgrades to @redocly/cli (v2.15.1) and jsdom (v28.0.0)
  • Enhanced error handling for authentication timeout/connection issues with expanded error code coverage
  • Improved session management to clear invalid cookies when token refresh fails
  • Added conditional service worker registration control for development environments

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.json Version bump to 1.4.7; dependency updates including @redocly/cli, jsdom, glob, node-domexception, and source-map; removed glob override
package-lock.json Lock file updates reflecting dependency changes
src/lib/supabase/middleware.ts Added try-catch error handling for getUser() with cookie cleanup on failure
src/components/sw-register.tsx Added development mode check to conditionally register service worker based on ENABLE_SW_IN_DEV
src/app/api/auth/save-token/route.ts Increased timeout from 5s to 15s; enhanced error handling for multiple network error codes
supabase/migrations/20260205195751_remote_schema.sql Added auth_password and auth_password_iv columns with consistency constraints
supabase/migrations/20260203_add_auth_password_column.sql Deleted separate migration file (consolidated into remote schema)
next.config.ts Added SERWIST_SUPPRESS_TURBOPACK_WARNING environment variable
Dockerfile Added SERWIST_SUPPRESS_TURBOPACK_WARNING=1 to build environment
.example.env Updated version number to 1.4.7
Comments suppressed due to low confidence (2)

supabase/migrations/20260205195751_remote_schema.sql:234

  • The auth_password and auth_password_iv columns were added to the remote schema in this migration, but the separate migration file 20260203_add_auth_password_column.sql was deleted. If that migration was previously applied in any environment, this creates a migration history inconsistency. Consider: (1) Keeping the old migration file for history, or (2) Documenting why it was consolidated, or (3) Ensuring no environment has applied the old migration yet.
    supabase/migrations/20260205195751_remote_schema.sql:234
  • The constraint syntax uses <> ''::"text" which appears to have an unusual cast syntax. This should be either <> '' or <> ''::text (without the double colon before the quotes). The current syntax ''::"text" may cause SQL parsing errors. Please verify this syntax is correct for PostgreSQL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 5, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 5, 2026

@devakesu I've opened a new pull request, #265, to work on those changes. Once the pull request is ready, I'll request review from you.

…agement (#265)

* Initial plan

* fix: address PR review feedback on error handling and dependencies

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* refactor: optimize middleware error detection

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

supabase/migrations/20260205195751_remote_schema.sql:234

  • The check constraints use the empty string comparison pattern (<> ''::"text"). While this is syntactically valid PostgreSQL, it's unusual syntax. The standard pattern would be <> '' or != ''. The ::text cast on an empty string literal is redundant since it's already a text literal. Consider simplifying to: CHECK ((auth_password_iv IS NULL) OR (auth_password_iv <> '')) for better readability and consistency with PostgreSQL conventions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 5, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 5, 2026

@devakesu I've opened a new pull request, #266, to work on those changes. Once the pull request is ready, I'll request review from you.

…logic (#266)

* Initial plan

* Address PR review: add ECONNREFUSED error code and remove redundant checks

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (2)

supabase/migrations/20260205195751_remote_schema.sql:234

  • The migration consolidation is good - the separate auth_password migration file has been removed and its changes have been incorporated into the remote_schema migration. However, ensure that any environments where the 20260203_add_auth_password_column.sql migration was already applied won't encounter issues. The new remote_schema.sql should handle this idempotently with IF NOT EXISTS checks or similar safeguards.
    supabase/migrations/20260205195751_remote_schema.sql:234
  • The check constraints use empty string comparison with '' which could be clearer using '' IS NULL pattern or a more explicit check. However, the current logic (auth_password <> ''::"text") correctly prevents empty strings while allowing NULL values. Consider adding a comment to clarify that these constraints ensure both fields are either both NULL or both non-empty strings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 5, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 5, 2026

@devakesu I've opened a new pull request, #267, to work on those changes. Once the pull request is ready, I'll request review from you.

…pendency (#267)

* Initial plan

* fix: improve error handling and remove deprecated package

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

supabase/migrations/20260203_add_auth_password_column.sql:1

  • The migration file 20260203_add_auth_password_column.sql is being deleted entirely, and its changes appear to be consolidated into the 20260205195751_remote_schema.sql file. However, if this migration has already been applied in any environment, deleting it could cause migration tracking issues. Ensure that the migration history is properly managed and that this deletion doesn't break environments where the original migration was already applied.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 6, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@devakesu I've opened a new pull request, #268, to work on those changes. Once the pull request is ready, I'll request review from you.

…n middleware (#268)

* Initial plan

* Improve error handling with structured properties and add npm version requirement

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Optimize error handling: move constants to module scope and improve type safety

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

supabase/migrations/20260205195751_remote_schema.sql:234

  • The migration file 20260203_add_auth_password_column.sql has been completely deleted, but the schema changes it contained (adding auth_password and auth_password_iv columns with constraints) have been moved into the 20260205195751_remote_schema.sql file. This creates a potential issue: if the earlier migration has already been applied in some environments, applying the remote schema migration might fail due to the columns already existing. Consider verifying that this consolidation won't cause issues in existing deployments, or add conditional logic (IF NOT EXISTS) to handle both scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 6, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@devakesu I've opened a new pull request, #269, to work on those changes. Once the pull request is ready, I'll request review from you.

…_DEV (#269)

* Initial plan

* Fix environment variable inconsistency in service worker registration

- Check both ENABLE_SW_IN_DEV and NEXT_PUBLIC_ENABLE_SW_IN_DEV
- Prioritize ENABLE_SW_IN_DEV (matching next.config.ts) with NEXT_PUBLIC_ as fallback
- Update logger message to document both options for backwards compatibility

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

* Use consistent environment variable NEXT_PUBLIC_ENABLE_SW_IN_DEV in both config and component

- Update next.config.ts to use NEXT_PUBLIC_ENABLE_SW_IN_DEV instead of ENABLE_SW_IN_DEV
- Update comments in next.config.ts to reflect the correct variable name
- Simplify sw-register.tsx to only check NEXT_PUBLIC_ENABLE_SW_IN_DEV
- This ensures users only need to set one environment variable for both build-time and runtime SW control

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

supabase/migrations/20260205195751_remote_schema.sql:234

  • The new auth_password and auth_password_iv columns store user authentication secrets in a reversibly encrypted form, which means that if the encryption key is ever exposed (e.g., via server compromise or logs), all user passwords can be decrypted. For password-like credentials, best practice is to use a one-way password hashing algorithm (e.g., bcrypt, scrypt, Argon2) so that even with full database and key access, attackers cannot directly recover the original passwords. Consider redesigning this flow to avoid storing decryptable user passwords at all (e.g., store non-reversible hashes or opaque tokens instead) and ensure that any remaining encrypted secrets are strictly limited and key-managed as high-value secrets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 6, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@devakesu I've opened a new pull request, #270, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Fix README and package.json per review feedback

Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: devakesu <61821107+devakesu@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devakesu
Copy link
Owner Author

devakesu commented Feb 6, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Feb 6, 2026

@devakesu I've opened a new pull request, #271, to work on those changes. Once the pull request is ready, I'll request review from you.

@devakesu devakesu merged commit 17626d8 into main Feb 6, 2026
13 of 14 checks passed
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.

2 participants