112
113
async deleteSessionData(session: URI): Promise<void> {
115
>
// Fire the will-delete event first so subscribers (notably the
116
>
// checkpoint service) can perform async cleanup that needs the
117
>
// database to still be readable. `waitUntil` collects each
118
>
// subscriber's promise; we await them all before touching disk.
119
>
const pending: Promise<unknown>[] = [];
120
>
try {
121
>
this._onWillDeleteSessionData.fire({
122
>
session,
123
>
waitUntil: p => { pending.push(p); },
124
>
});
125
>
} catch (err) {
126
this._logService.warn(`[SessionDataService] onWillDeleteSessionData listener threw synchronously: ${dir.toString()}`, err);
127
}
129
const results = await Promise.allSettled(pending);
130
for (const r of results) {