-
Notifications
You must be signed in to change notification settings - Fork 21
🐛 Fix promise support of Cloud.run #106
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
Conversation
| return AV.User.become(options.sessionToken); | ||
| } | ||
| }).then(function(user) { | ||
| user = user || options.user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
目前在当前进程里调用的时候,不会使用当前全局的 currentUser,这个应该算 bug 还是 feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature 呀,从 1.0 之后就没有全局的 currentUser 了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在想在本地单元测试里,直接调用云函数进行测试,这样就需要一直指定当前 user,感觉比较奇怪。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果没有全局的 currentUser 当然就只能这么做了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的啊,但是这样有些奇怪,即时我主动开启 currentUser,也是还是需要显式指定的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在也是没办法主动开启全局 currentUser 了吧,或者说开了就完全没法用了(因为现在没有 domain 了)。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SDK 作为客户端的话,是会使用的,因为会使用当前用户的 session token 来发送请求。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有道理,当时确实是这么说的。所以应该在 Node SDK 所有用到用户的地方检查全局的 currentUser 有没有开启,就像在 JS SDK 里一样
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,不过和这个 PR 没什么关系,我测试了发现没问题,可以合并了。
No description provided.