your tested.
# contributing
p
your tested.
There are structural mistakes in some places, it would be great if you could tag the people in charge here and I can communicate comfortably.
cc: @rp_st @porcellus
p
structural mistakes?
p
this old code, problem
p
why is it a problem?
p
p
why do you think the two are connected?
p
The tests are now working for me, I have successfully transferred gear, but the code you wrote here is misspelled.
p
misspelled?
p
I didn't throw it, it's your own code
live voice
p
no, please write it out.
so I still do not see how the test failure and throwing that error is connected
p
Tests are running so far, no problem, now the error is water.
Copy code
ts
 createNewSession: async (input) => {
                    const response = await oI.createNewSession(input)
                    process.env.user = response.getUserId()
                    throw {
                      error: 'sign up error',
                    }
                  },
you wrote this code like this, but this spelling is not correct, it does not throw 500 error
p
is this test passing in the main branch?
p
yes
p
then the old code is correct.
also, it is a 404 error, I do not see how that could be connected to the error thrown there.
p
this main old code
then i get 404 test. 500 seems illogical to me too
404 correct thats true ?
p
so if an unexpected error is thrown a "not found" error is more logical than an "internal server error"?
for future reference, if something is working in the base branch, and not in your branch (which basically touches every file in the SDK) then it is likely a bug in your branch.
p
I will leave this test as todo for now and continue to pass other tests, if it comes out somewhere else, it's like you said.
https://github.com/supertokens/supertokens-node/pull/505 I want you to take a quick look at this. Now I carry the tests in vitest. Thank you back message.
p
happy to help.
p
your build is great, thank you, but I will make the structure 10x better. In this way, people who write TS can work comfortably here.
p
Also about checking out your branch: the changeset (1000+ files) is just too big for me to dedicate time to it right now. I'm happy to help if you have specific questions or you find something that doesn't work in the base branch.
p
yes, don't waste your time anyway, just know what you're doing. you focus on the main core structure, I will make this place as beautiful as the world. I hope I can finish it as soon as possible.
There are an incredible number of tests. 🙂
I'm wondering why docker doesn't connect directly. Docker tests may be faster.
Your java tests are on the java side, after all.
p
I'm not sure, in my experience running in containers do not tend to make things faster, plus starting and stopping the container. The container would be running java all the same, so there is no gain there, but there is an overhead with starting and stopping the containers.
So the reason is basically: there is no performance gain there and this way it's very easy to test new java code (kind of like an integration test)
p
https://github.com/supertokens/supertokens-node/blob/9311e530fc56cd87927536d8ff94c1951d10c283/lib/ts/recipe/session/sessionClass.ts#L94-L103 accessTokenPayloadUpdate
undefined
You can send Undefined data in the tests, there is a writing wrong here
i am convert func okay ?
Copy code
ts
    // Any update to this function should also be reflected in the respective JWT version
  async mergeIntoAccessTokenPayload(accessTokenPayloadUpdate?: any, userContext?: any): Promise<void> {
    const updatedPayload = { ...this.getAccessTokenPayload(userContext), ...accessTokenPayloadUpdate }

    if (accessTokenPayloadUpdate) {
      for (const key of Object.keys(accessTokenPayloadUpdate)) {
        if (accessTokenPayloadUpdate[key] === null)
          delete updatedPayload[key]
      }
      await this.updateAccessTokenPayload(updatedPayload, userContext)
    }

    if (accessTokenPayloadUpdate === undefined)
      await this.updateAccessTokenPayload(undefined, undefined)
  }
2. problem
r
i think this is got to do with the node version / os being used. I do remember running into this issue before, but i don't completely recall the solution
p
can't we use jsonwebtoken -> jose ? https://github.com/panva/jose
r
We will be. We are going to release an update soon that uses jose
p
Until then, I will continue these tests with errors. 👍
example ts convert test passed but same ts problem
In the meantime, there are structures that have forgotten old test codes or types that have not been entered, in the main code structure as well as in the tests.
example problems
If the spelling in the test is correct, I will change the main codes
main , the code was written wrong for her, I'm fixing them too. types in correct but class problem
same problem diffrent emailverifaciton
I'm arranging all of these, the main codes are different according to the interface you wrote. input: {} needs to be entered as an object
p
The types are different between the recipe interface (they are used when overriding) and the index files which is basically the user facing interface. They are intentionally different, this is not a problem.
Also, the tests are working, so the tests are using the right one.
p
no test error
actually it gave me 1 error so i was changing all of them. then the test is wrong code is it right
example test, old code
p
I think this test only fails after your changes. both the tests and the main code were right.
p
different error
I will collect all the tests that fail in this way, we will take a look at the last thing when everything is over.
we can run this test directly from the shortcut, because new test system vitest (https://vitest.dev/).
finishhhh 🥰 🚀 all test js to ts same problem
really good luck to everyone's hands. TS interface errors are among the main codes available, but they do not affect the test result. Thanks to this, we fix interface errors in the main code over time.
@porcellus local all test how many total minutes does it take on your computer
p
not sure I'd guess about 1h
also, I don't think there are any interface errors in main, that has been check thoroughly.
if you have any please provide an example and why you think it's an error
p
🥰 finish all testend js to ts. but 6 failed test total.
hmm okay, i am I understand now, thank yoo all back message
how many tests are there in total ?
finish
How can I know if this is true or not? no mistake i guess
please check
esm 'body-parser' problem
this package diffrent change body-parser used.
@porcellus this how to fix code ? i am locally testting my pr this project
okay fixed
Copy code
ts
import supertokens from 'supertokens-node'
import {Github, init as ffff} from "supertokens-node/recipe/thirdpartyemailpassword";

export default defineNitroPlugin((nitroApp) => {
    supertokens.init({
        framework: 'h3',
        supertokens: {
            // https://try.supertokens.com is for demo purposes. Replace this with the address of your core instance (sign up on supertokens.com), or self host a core.
            connectionURI: 'xxxxx',
            apiKey: 'xxxx',
        },
        appInfo: {
            // learn more about this on https://supertokens.com/docs/session/appinfo
            appName: 'Nitro App',
            apiDomain: 'localhost:3000',
            websiteDomain: 'localhost:3000',
            apiBasePath: '/auth',
            websiteBasePath: '/auth',
        },
        recipeList: [
            ffff({
                providers: [
                    Github({
                        clientId: "5b79c4fba474b592491d",
                        clientSecret: "aa322fcf9cddcc0529708bf61a94f13ac784010f"
                    }),
                ],
            }),
        ],
    })
})
this why problem ?
Do you have any guesses?
up error
[worker reload] TypeError [Error]: Cannot read properties of undefined (reading 'emailPasswordEmailExistsGET')
p
not really: since there are so many changes in your branch my guesses are not that useful.
you can check where that function is called/the callstack
3 Views