Skip to content

Commit

Permalink
Desktop: Improved sharing error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Aug 5, 2023
1 parent 16d8a78 commit 95ca89b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/lib/services/share/ShareService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,23 @@ export default class ShareService {
public async maintenance() {
if (this.enabled) {
let hasError = false;

try {
await this.refreshShareInvitations();
} catch (error) {
hasError = true;
logger.error('Maintenance: Failed to update share invitations:', error);
}

try {
await this.refreshShares();
Setting.setValue('sync.userId', this.api().userId);
} catch (error) {
hasError = true;
logger.error('Failed to run maintenance:', error);
logger.error('Maintenance: Failed to refresh shares:', error);
}

Setting.setValue('sync.userId', this.api().userId);

// If there was no errors, it means we have all the share objects,
// so we can run the clean up function.
if (!hasError) await this.updateNoLongerSharedItems();
Expand Down

0 comments on commit 95ca89b

Please sign in to comment.