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

save 的行为和 JS SDK 不一致 #489

Open
weakish opened this issue Aug 3, 2020 · 0 comments
Open

save 的行为和 JS SDK 不一致 #489

weakish opened this issue Aug 3, 2020 · 0 comments
Labels
next breaking changes

Comments

@weakish
Copy link
Contributor

weakish commented Aug 3, 2020

const d = await new AV.Query('TestObject').get('5f27bc73fbb489000824300d')
console.log(d.get('testList'))
listData = d.get('testList')
listData.push('debug')
await d.save()

上面这段 JS 代码,最终云端的 testList 会包含 debug 这个值,但是等效的 Python 代码,testList 并不会包含 debug 这个值。 python SDK 的 save 没有 JS SDK 的这么智能。python SDK 只有在调用 set 方法(或 add_unique 之类的类 set 方法时才会更新内部维护的 _changes 状态,最终在 save 时将更新发送给云端)。python SDK 的行为实现上更简单,但可能导致用户感到困惑。下一个大版本需要考虑是否需要把行为改成和 JS SDK 一致。

相关论坛帖子 23120

@weakish weakish added the next breaking changes label Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next breaking changes
Projects
None yet
Development

No branches or pull requests

1 participant