strapi-connector-firestore icon indicating copy to clipboard operation
strapi-connector-firestore copied to clipboard

Relation handler cannot handle FieldOperation values

Open brettwillis opened this issue 2 years ago • 0 comments

The FieldOperation (similar to the native FieldValue) class is currently a private API, so this is low priority. But we may wish to make FieldOperation a public API, at which point this will be a problem.

If the user runs a direct transaction (model.runTransaction(...)) and uses FieldOperation to atomically update a relation attribute, then the RelationHandler will crash - it cannot yet handle FieldOperation instances.

See:

https://github.com/arrowheadapps/strapi-connector-firestore/blob/09bd0e5babf66f1dce6a3ed9b7aa074f7583e558/src/utils/relation-handler.ts#L335-L337

brettwillis avatar Aug 24 '21 23:08 brettwillis