Skip to content

Error: schema mismatch Operation instances #4884

Closed

Description

@Aetherall

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 !

Activity

  1. flovilmart commented on Jul 10, 2018

    @flovilmart
    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.

  2. Aetherall commented on Jul 10, 2018

    @Aetherall
    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

  3. Aetherall commented on Jul 10, 2018

    @Aetherall
    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'

  4. changed the title [-]PR => extending Parse.Object[/-] [+]Error: schema mismatch Operation instances[/+] on Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions