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

fix: return storage mode submission version when when retrieving from server #2112

Merged
merged 5 commits into from
Jun 9, 2021

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Jun 9, 2021

Problem

Currently, the encrypted submission object returned does not return the version number, whilst formsg-javascript-sdk#decrypt requires the version number in the param (but not used since we only have 1 version so far).

This bug does not affect prod, since the version parameter is actually unused by the SDK. This is to prevent future updates from breaking and to correctly return expected required parameters when retrieving storage mode responses.

This PR returns the version number when retrieving submission (meta)data regardless so that the decrypt call doesn't need a mock version number parameter.

Closes #2029

Solution

Breaking Changes

  • No - this PR is backwards compatible

Bug Fixes:

  • add version key when retrieving storage mode submission data
  • pass version on client when decrypting storage mode responses

Tests

Tests have been updated to account for the new version key returned.

Manual test

  • View individual storage mode response. Should decrypt and display correctly
  • Download storage mode response (without attachment). Should download correctly and correct responses decrypted.
  • Download storage mode response. same as above.

@karrui
Copy link
Contributor Author

karrui commented Jun 9, 2021

@seaerchin this fixes the need to hardcode the version number in a Typescript file calling the SDK. However, this PR may also introduce conflicts. See which one gets merged first.

@karrui karrui merged commit 88cf5f4 into develop Jun 9, 2021
@karrui karrui deleted the fix/return-submission-version branch June 9, 2021 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants