You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
customObjectId does not work with beforeSave triggers #6733
Any update on this? I am having same issue. I was saving custom object ids from express app, and it was working fine. And as soon as I add beforeSave trigger, it started discarding the provided custom ids, and stored objects with newly generated ids by parse.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
So i found the reason and a solution. getResponseObject calls _getSaveJSON this in turn removes the objectId.
A simple solution would be to add this to the resolver of getResponseObject . This fixes the issue - as it adds the id back if it is missing from modified object!
another option would the to just remove _getSaveJSON if allowCustomObjectId is set. This should be fine as this is not called if a before save trigger ist not set, so removing it will probably not have any side effects. Checking ensures that it would change stuff in cases where the current codebase is already broken.
Activity
JeromeDeLeon commentedon Jun 14, 2020
I think inside PServer, It uses JS-SDK and in it, it is not yet implemented. parse-community/Parse-SDK-JS#1097
ArkeshGKalathiya commentedon Sep 18, 2020
Any update on this? I am having same issue. I was saving custom object ids from express app, and it was working fine. And as soon as I add beforeSave trigger, it started discarding the provided custom ids, and stored objects with newly generated ids by parse.
stale commentedon Nov 8, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
felix-ht commentedon Feb 2, 2021
I can confirm - we have the same issue
bdevore17 commentedon Feb 2, 2021
Same!
felix-ht commentedon Feb 2, 2021
@JeromeDeLeon
So i found the reason and a solution.
getResponseObjectcalls_getSaveJSONthis in turn removes the objectId.A simple solution would be to add this to the resolver of
getResponseObject. This fixes the issue - as it adds the id back if it is missing from modified object!another option would the to just remove
_getSaveJSONif allowCustomObjectId is set. This should be fine as this is not called if a before save trigger ist not set, so removing it will probably not have any side effects. Checking ensures that it would change stuff in cases where the current codebase is already broken.JeromeDeLeon commentedon Feb 5, 2021
It would be better if you could create a PR for this to further discuss this. @felix-ht
fix: Pass customObjectId in beforeSave (#7167)
fix: Pass customObjectId in beforeSave (#7167)
dplewis commentedon Feb 24, 2021
allowCustomObjectId has been added to the JS SDK and merged with the server.
#7222
I'll try to do a PR to fix this issue.
canyousayyes commentedon Mar 3, 2021
We countered the same issue and glad to know the bug fix has been merged. Any plans to release this fix in the soon future?
fix: Pass customObjectId in beforeSave (parse-community#7167)
lsmilek1 commentedon Apr 25, 2021
+1 - Any plans to release this fix in the soon future?
fix: Pass customObjectId in beforeSave (parse-community#7167)
chore(release): 5.0.0-beta.1 [skip ci]
gtzinos commentedon Jan 13, 2022
any update on this?
mtrezza commentedon Jan 13, 2022
The first step would be to open a PR and demonstrate the issue with a failing test. From there, we can look for a fix.
chore(release): 5.0.0 [skip ci]
Squashed commit of the following: