Skip to content

Commit 86c5276

Browse files
committed
track update error
1 parent a41b6f8 commit 86c5276

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/services/highlighter/ai-highlighter-updater.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class AiHighlighterUpdater {
129129
*/
130130
public async isNewVersionAvailable(): Promise<boolean> {
131131
// check if updater checked version in current session already
132-
if (this.versionChecked) {
132+
if (this.versionChecked || Utils.getHighlighterEnvironment() === 'local') {
133133
return false;
134134
}
135135

@@ -235,7 +235,7 @@ export class AiHighlighterUpdater {
235235
const binPath = path.resolve(AiHighlighterUpdater.basepath, 'bin');
236236
const outdateVersionPresent = existsSync(binPath);
237237

238-
// backup the ouotdated version in case something goes bad
238+
// backup the outdated version in case something goes bad
239239
if (outdateVersionPresent) {
240240
console.log('backing up outdated version...');
241241
await fs.rename(binPath, path.resolve(AiHighlighterUpdater.basepath, 'bin.bkp'));

app/services/highlighter/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,12 @@ export class HighlighterService extends PersistentStatefulService<IHighlighterSt
11451145
this.SET_UPDATER_STATE(true);
11461146
this.SET_HIGHLIGHTER_VERSION(this.aiHighlighterUpdater.version || '');
11471147
await this.aiHighlighterUpdater.update(progress => this.updateProgress(progress));
1148+
} catch (e: unknown) {
1149+
console.error('Error updating AI Highlighter:', e);
1150+
this.usageStatisticsService.recordAnalyticsEvent('Highlighter', {
1151+
type: 'UpdateError',
1152+
new_version: this.aiHighlighterUpdater.version,
1153+
});
11481154
} finally {
11491155
this.SET_UPDATER_STATE(false);
11501156
}

0 commit comments

Comments
 (0)