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

JSON Column Data Altered During Switchover #3942

Open
mastercactapus opened this issue Jun 26, 2024 · 0 comments
Open

JSON Column Data Altered During Switchover #3942

mastercactapus opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mastercactapus
Copy link
Member

Describe the Bug:
The data contained within json-type columns seems to get altered during a switchover operation. Specifically, the order of keys in the JSON policy column of gql_api_keys changes after performing a switchover.

Steps to Reproduce:

  1. Run GoAlert commit a25f8082e975812ff5d4b88416768cd931aaa34c or earlier (using make start-swo)
  2. Create a GraphQL API key and verify it functions
  3. Perform a switchover (Admin > Switchover)
  4. Observe that the API key no longer works

Expected Behaviour:
For json-type columns, the data should be preserved exactly during switchover operations. This includes preventing change to the order of keys within the JSON documents stored within these columns.

Observed Behavior:
After performing a switchover, the order of keys in the JSON data changes. This suggests that the data might be parsed into a map and then re-encoded, rather than being copied as a json.RawMessage.

Application Version:
This issue affects all known versions up to and including the commit a25f8082e975812ff5d4b88416768cd931aaa34c.

Additional Context:
This issue was identified due to GraphQL API keys being rejected following a switchover, as the data alteration resulted in a hash mismatch.

This issue specifically affects the backend.

@mastercactapus mastercactapus added the bug Something isn't working label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant