mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-18 16:33:00 +00:00
Merge pull request #8422 from overleaf/ta-silent-error
Silence Error If AffiliationUnchecked Flag Cannot Be Unset GitOrigin-RevId: 1e0ffc401dfcc1ac9ae1a3d1de850ab899b4ce8e
This commit is contained in:
parent
ff6c88de0c
commit
c30ec5fa7c
2 changed files with 17 additions and 7 deletions
|
@ -371,13 +371,15 @@ async function addAffiliationForNewUser(
|
||||||
{ $unset: { 'emails.$.affiliationUnchecked': 1 } }
|
{ $unset: { 'emails.$.affiliationUnchecked': 1 } }
|
||||||
)
|
)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw OError.tag(
|
logger.error(
|
||||||
error,
|
OError.tag(
|
||||||
'could not remove affiliationUnchecked flag for user on create',
|
error,
|
||||||
{
|
'could not remove affiliationUnchecked flag for user on create',
|
||||||
userId,
|
{
|
||||||
email,
|
userId,
|
||||||
}
|
email,
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,6 +160,14 @@ describe('UserUpdater', function () {
|
||||||
{ $unset: { 'emails.$.affiliationUnchecked': 1 } }
|
{ $unset: { 'emails.$.affiliationUnchecked': 1 } }
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should not throw if removing affiliationUnchecked flag errors', async function () {
|
||||||
|
this.db.users.updateOne.rejects(new Error('nope'))
|
||||||
|
await this.UserUpdater.promises.addAffiliationForNewUser(
|
||||||
|
this.user._id,
|
||||||
|
this.newEmail
|
||||||
|
)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('changeEmailAddress', function () {
|
describe('changeEmailAddress', function () {
|
||||||
|
|
Loading…
Reference in a new issue