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: Saving object with a pointer field set to undefined throws error for Postgres #9147

Open
wants to merge 7 commits into
base: alpha
Choose a base branch
from

Conversation

andrewalc
Copy link

@andrewalc andrewalc commented Jun 6, 2024

Pull Request

Issue

Closes: #9146

Approach

Work in progress, attempting to write a failing test case. Need to see if it fails for Postgres in CI (afaik i can only test on mongo locally. It passes for mongo but shouldn't for postgres)

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: error thrown on undefined pointer for postgres fix: Error thrown on undefined pointer for postgres Jun 6, 2024
Copy link

Thanks for opening this pull request!

spec/PostgresStorageAdapter.spec.js Outdated Show resolved Hide resolved
spec/PostgresStorageAdapter.spec.js Outdated Show resolved Hide resolved
spec/PostgresStorageAdapter.spec.js Outdated Show resolved Hide resolved
Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
@@ -570,6 +570,35 @@ describe_only_db('postgres')('PostgresStorageAdapter', () => {
await adapter.deleteIdempotencyFunction();
await client.none(qs);
});

it('saves object with a pointer field set to undefined', async () => {
Copy link
Member

@mtrezza mtrezza Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be moved to where the existing pointer tests are, as it's not a postgres specific test, even if the issue occurs only with postgres.

Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
@mtrezza mtrezza changed the title fix: Error thrown on undefined pointer for postgres fix: Saving object with a pointer field set to undefined throws error for Postgres Jun 7, 2024
@mtrezza mtrezza changed the title fix: Saving object with a pointer field set to undefined throws error for Postgres fix: Saving object with a pointer field set to undefined throws error for Postgres Jun 7, 2024
@mtrezza
Copy link
Member

mtrezza commented Jun 7, 2024

Test passes for Postgres and MongoDB. Is this issue related to your custom code?

@mtrezza mtrezza marked this pull request as ready for review June 7, 2024 09:37
@andrewalc
Copy link
Author

Test passes for Postgres and MongoDB. Is this issue related to your custom code?

I just found out how to test with postgres locally so I'm gonna try setting that up properly first. My issue might be because I didn't configure postgres for parse correctly.

@mtrezza
Copy link
Member

mtrezza commented Jun 11, 2024

@andrewalc sure, let us know how it goes, and whether the related issue can be closed.

@andrewalc
Copy link
Author

andrewalc commented Jun 11, 2024

@andrewalc sure, let us know how it goes, and whether the related issue can be closed.

posted an update in the issue here, might try again if i find some time but it seems like the case i have refuses to fail in this repo

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.

Parse server throws an error when saving an object with a pointer field set to undefined (Postgres only)
2 participants