Skip to content

Conversation

@jysperm
Copy link
Contributor

@jysperm jysperm commented Apr 25, 2017

No description provided.

return AV.User.become(options.sessionToken);
}
}).then(function(user) {
user = user || options.user;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前在当前进程里调用的时候,不会使用当前全局的 currentUser,这个应该算 bug 还是 feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feature 呀,从 1.0 之后就没有全局的 currentUser 了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在想在本地单元测试里,直接调用云函数进行测试,这样就需要一直指定当前 user,感觉比较奇怪。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果没有全局的 currentUser 当然就只能这么做了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的啊,但是这样有些奇怪,即时我主动开启 currentUser,也是还是需要显式指定的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在也是没办法主动开启全局 currentUser 了吧,或者说开了就完全没法用了(因为现在没有 domain 了)。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK 作为客户端的话,是会使用的,因为会使用当前用户的 session token 来发送请求。

Copy link
Contributor Author

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 里一样

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯,不过和这个 PR 没什么关系,我测试了发现没问题,可以合并了。

@jysperm jysperm merged commit c09e6e8 into master May 3, 2017
@jysperm jysperm removed the review label May 3, 2017
@jysperm jysperm deleted the cloud-run branch August 2, 2017 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants