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

beforeUpdate 支持用户指定允许更新的字段 #59

Closed
jysperm opened this issue Apr 29, 2016 · 4 comments
Closed

beforeUpdate 支持用户指定允许更新的字段 #59

jysperm opened this issue Apr 29, 2016 · 4 comments

Comments

@jysperm
Copy link
Contributor

jysperm commented Apr 29, 2016

经过和晓丹的讨论 https://github.com/leancloud/uluru-platform/issues/2101 ,beforeUpdate 中支持:

res.success(['a', 'b']); // 允许更新 a, b 两列
res.success(); // 兼容原有写法,等价于 res.success(req.object.updatedKeys);

然后 Node SDK 向云存储返回一个数组结果表示允许更新的列,旧版本会返回 req.object.

@sdjcw
Copy link
Contributor

sdjcw commented Apr 29, 2016

好人性化(复杂)的功能啊~~

@killme2008
Copy link
Contributor

{
 "_updatedKeys": [ ]
}

@sdjcw
Copy link
Contributor

sdjcw commented Aug 9, 2016

我不太明白这个特性的需求。
客户端如果同时更新多个属性,很有可能这些属性之前存在关联性,或者说更新的原子性。而云引擎的 hook 可以轻易的打破这种约束,导致某些字段更新,而另一些字段没有更新,更尴尬的事这事发生的时候,客户端完全不知情,而且可能还缓存了错误的修改(服务端个别字段没有更新,但是客户端收到更新响应 200,认为所有更新都有效)。

@jysperm
Copy link
Contributor Author

jysperm commented May 31, 2019

这个功能还是不做了,确实如陈伟所说,加了之后会引入一种「部分成功」的状态,会增加很多复杂度。而且最近很长一段时间,并没有遇到需要这个特性才能满足的需求。

@jysperm jysperm closed this as completed May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants