Skip to content

Commit

Permalink
fix(uidvalidity): Do not expect UIDVALIDITY to always exist
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Dec 5, 2024
1 parent ce867a3 commit 7761653
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/commands/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = async (connection, path, options) => {
extraArgs.push([
{ type: 'ATOM', value: 'QRESYNC' },
[
{ type: 'ATOM', value: options.uidValidity.toString() },
{ type: 'ATOM', value: options.uidValidity?.toString() },
{ type: 'ATOM', value: options.changedSince.toString() }
]
]);
Expand Down
6 changes: 5 additions & 1 deletion lib/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ module.exports = {
}
}

map.id = map.emailId || createHash('md5').update([path, mailbox.uidValidity.toString(), map.uid.toString()].join(':')).digest('hex');
map.id =
map.emailId ||
createHash('md5')
.update([path, mailbox.uidValidity?.toString() || '', map.uid.toString()].join(':'))
.digest('hex');
}

if (map.flags) {
Expand Down

0 comments on commit 7761653

Please sign in to comment.