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

Error: schema mismatch Operation instances #4884

Closed
Aetherall opened this issue Jul 10, 2018 · 3 comments
Closed

Error: schema mismatch Operation instances #4884

Aetherall opened this issue Jul 10, 2018 · 3 comments

Comments

@Aetherall
Copy link

I am adding a field level permission layer using beforeSave triggers

For this to work, I use a class extending Parse.Object to extend my Data Classes.

This works like a charm on the client, on the server, I am experiencing issues when the data get decoded before "beforeTrigger"s:

The Operations like AddOp get interpreted as "part of the data" and it messes up the "to be saved" data

I am looking for someone who could lead me in the right direction about where to look to fix the issue, and why not do a PR afterward

Thanks !

@flovilmart
Copy link
Contributor

Can you share the code and open the PR? Depending where uou’re Injecting this logic, you may be mistaken. This layer of validation should probably be in RestWrite, using the Schema table as a reference.

@Aetherall
Copy link
Author

I found out that the AddOp created by
parse-server > RestWrite > sanitizedData > Parse._decode
is not an instance of the ParseOp.Op from
parse-sdk > ParseObject > set

It may be a problem relative to my setup ( webpack on both client and server with both HMR )

I tried to bundle the parse-server within my server bundle but I got errors due to relative SQL files
I tried with the SDK too but it doesn't seem to change anything

@Aetherall
Copy link
Author

I found it, the class used 'parse/browser' from client because the server imported the client app for SSR

To fix it, I created global.Parse on the client too and stopped importing 'parse'

@Aetherall Aetherall changed the title PR => extending Parse.Object Error: schema mismatch Operation instances Jul 10, 2018
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

No branches or pull requests

2 participants