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

Upgrade SuperTokens to v5 #2612

Closed
n1ru4l opened this issue Jul 17, 2023 · 0 comments
Closed

Upgrade SuperTokens to v5 #2612

n1ru4l opened this issue Jul 17, 2023 · 0 comments
Assignees

Comments

@n1ru4l
Copy link
Contributor

n1ru4l commented Jul 17, 2023

Supertokens 4.6 → 5.0 Upgrade Protocol

Supertokens 4.6 to 5.0 has breaking changes, which require careful granular steps for upgrading and deploying GraphQL Hive.

Rollout Plan

1. Make sure all CDI API calls use cdi-version 2.20

We have some manual fetch calls (integration-tests and API/server).
We need to make sure they use the latest supported cdi-version of 4.6 and 5.0.

Implementation PR:
#2604

Docker Hash to Deploy to Production:
9e935d2e068a41b7cf217fa27db4e9b3d8c5acc1

2. Prepare Database (pre step 3)

We need to run some manual SQL for preparing the tables for supertokens-core 5.0.
Connect to the database with your favorite tool and run the following SQL query:

ALTER TABLE supertokens_session_info 
  ADD COLUMN use_static_key BOOLEAN NOT NULL DEFAULT(false)
;

3. Bump and deploy supertokens-postgresql:5.0

Bump and deploy registry.supertokens.io/supertokens/supertokens-postgresql:5.0

Implementation PR:
#2602
Docker Hash to Deploy to Production:
58bc873526f087b849283294c8d9ce685536030f

4. Cleanup Database (post step 3)

We need to run some manual SQL for supertokens-core 5.0.
Connect to the database with your favorite tool and run the following SQL query:

ALTER TABLE supertokens_session_info
  ALTER COLUMN use_static_key DROP DEFAULT
;

5. Upgrade used Supertokens CDI versions and SDKs

Upgrade cdi-version 2.20.0 —> 2.21.0
After we rolled out the new supertokens version we can adjust our code to now use CDI 2.21 instead of 2.20.

  1. Upgrade supertokens-node to **14.1.3 (**https://github.com/supertokens/supertokens-node/blob/master/CHANGELOG.md#1413---2023-07-03)
  2. Adjust manual fetch calls (integration-tests and API/server)

Implementation PR:
#2605
Docker Hash to Deploy to Production:
67abf74c90ecc3bbe28cb03c58cf785579f8767b


Issues

Random error on API (server service) after upgrading

SuperTokens session verification failed with status 400.
Field name 'checkDatabase' is invalid in JSON input
"supertokens-node": "13.4.2"

Solution:

We did not pin an HTTP call to a cdi-version (709fc63)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant