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 Multipage Error & Adding Completion Stamps #43

Merged
merged 8 commits into from
Nov 23, 2021
Merged

Fixing Multipage Error & Adding Completion Stamps #43

merged 8 commits into from
Nov 23, 2021

Conversation

karansampath
Copy link
Member

@karansampath karansampath commented Nov 19, 2021

Have modified the code to deal with multipage #40 breaking earlier changes in #42. There still seems to be an error caused by the crypto key which I'm unsure how to rectify @sumants-dev. Have attached the stack trace below:

TypeError [ERR_INVALID_ARG_TYPE]: The "password" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at check (internal/crypto/scrypt.js:75:14)
    at Object.scryptSync (internal/crypto/scrypt.js:51:13)
    at Object.<anonymous> (/Users/karansampath/Documents/GitHub/surveyor/built/util.js:6:26)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/karansampath/Documents/GitHub/surveyor/built/routes/survey.js:53:14) {
  code: 'ERR_INVALID_ARG_TYPE'
}

@karansampath karansampath changed the title Fixing Surveyor Error Fixing Multipage Error Nov 19, 2021
@sumants-dev
Copy link
Collaborator

Ok, I'll look into it now

@sumants-dev
Copy link
Collaborator

sumants-dev commented Nov 19, 2021

That crypto error is most likely because of the .env file. Note the iv key here should never be used for production. I'll update the readme to reflect the fact. There is another error I'll try to debug.

PORT=4000
MONGO=TRUE
PROD=FALSE
TEST_DB=test_db
TEST_URI=mongodb://localhost:27017
PROD_DB=nothing
PROD_URI=nothing
RANDOM=TESTISRANDOM
TOKEN_KEY=TESTISRANDOM
SECRET_KEY=TESTISRANDOM
ENCRYPT_KEY=TESTISRANDOM
IV_KEY=a0f5c2b327abb291c7cecdea1b2f8cc5 
DOMAIN=http://localhost:4000/

@sumants-dev
Copy link
Collaborator

https://www.loom.com/share/d11c57402cc141a48d1adda53fe6c126
Couple of the conditionals were wonky. Separate out functionalities into separate functions so it is easier to reason.

@karansampath Can you test if the multipage surveys works with more than one question on each page?

@sumants-dev
Copy link
Collaborator

https://www.loom.com/share/aace88098ef54b7b8f7dc19f0c3f4fdc
It is good to go from my end. I tested the multiple questions.

The curr page is 1 forward.
@karansampath
Copy link
Member Author

My computer crashed, and I've been unable to run and verify the code since. The following error keeps showing up:

Error: Please set mongo db uri or db
    at Object.<anonymous> (/Users/karansampath/Documents/GitHub/surveyor/built/config.js:18:11)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/Users/karansampath/Documents/GitHub/surveyor/built/server.js:45:16)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
The terminal process "zsh '-c', 'npm run start'" terminated with exit code: 1.

Looked over it and doesn't seem to have any issues.

@sumants-dev
Copy link
Collaborator

sumants-dev commented Nov 20, 2021 via email

@sumants-dev
Copy link
Collaborator

sumants-dev commented Nov 23, 2021

@markwhiting I've tested this on the server, and I think this should be ready to go. @karansampath DM me and we can try to resolve these issue on your local machine.

@sumants-dev sumants-dev changed the title Fixing Multipage Error Fixing Multipage Error & Adding Completion Stamps Nov 23, 2021
@sumants-dev sumants-dev disabled auto-merge November 23, 2021 20:17
@sumants-dev sumants-dev enabled auto-merge (squash) November 23, 2021 20:17
@sumants-dev sumants-dev merged commit 6febf8b into main Nov 23, 2021
@sumants-dev sumants-dev deleted the fix branch November 23, 2021 20:34
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.

Queries should be able to be added onto an encrypted URL An endpoint for requesting encrypted urls
3 participants