mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Make sure identities resolve before sending them to activity().
This commit is contained in:
parent
349cdd4bf9
commit
43c180c247
1 changed files with 11 additions and 6 deletions
17
sandstorm.js
17
sandstorm.js
|
@ -108,12 +108,17 @@ if (isSandstorm && Meteor.isServer) {
|
||||||
Meteor.wrapAsync((done) => {
|
Meteor.wrapAsync((done) => {
|
||||||
return Promise.all(users.map((user) => {
|
return Promise.all(users.map((user) => {
|
||||||
return httpBridge.getSavedIdentity(user.id).then((response) => {
|
return httpBridge.getSavedIdentity(user.id).then((response) => {
|
||||||
return { identity: response.identity,
|
// Call getProfile() to make sure that the identity successfully resolves.
|
||||||
mentioned: !!user.mentioned,
|
// (In C++ we would instead call whenResolved() here.)
|
||||||
subscribed: !!user.subscribed,
|
const identity = response.identity;
|
||||||
};
|
return identity.getProfile().then(() => {
|
||||||
}).catch(() => {
|
return { identity,
|
||||||
// Ignore identities that fail to restore. Probably they have lost access to the board.
|
mentioned: !!user.mentioned,
|
||||||
|
subscribed: !!user.subscribed,
|
||||||
|
};
|
||||||
|
}).catch(() => {
|
||||||
|
// Ignore identities that fail to resolve. Probably they have lost access to the board.
|
||||||
|
});
|
||||||
});
|
});
|
||||||
})).then((maybeUsers) => {
|
})).then((maybeUsers) => {
|
||||||
const users = maybeUsers.filter((u) => !!u);
|
const users = maybeUsers.filter((u) => !!u);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue