mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Merge pull request #2274 from PR0M3TH3AN/jules-13684010680817727303-91013058
Automated PR Review: Fix test timeouts and report findings
This commit is contained in:
2 files changed
+11
-5
No files matched your search
+10
-5
@@ -913,15 +913,20 @@ class SubscriptionsManager {
|
||||
// scheme × up to 3 schemes = ~18s) = ~30s. Reduced from 45s to prevent
|
||||
// blocking the login path for nearly a minute.
|
||||
const timeoutMs = 25000;
|
||||
let timeoutId;
|
||||
await Promise.race([
|
||||
loader,
|
||||
new Promise((_, reject) =>
|
||||
setTimeout(
|
||||
new Promise((_, reject) => {
|
||||
timeoutId = setTimeout(
|
||||
() => reject(new Error("Timeout loading subscriptions")),
|
||||
timeoutMs
|
||||
)
|
||||
),
|
||||
]);
|
||||
);
|
||||
}),
|
||||
]).finally(() => {
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
});
|
||||
devLogger.log("[SubscriptionsManager] ensureLoaded success");
|
||||
return { ok: this.dataReady === true, error: this.lastLoadError || null, state: this.getLoadState() };
|
||||
} catch (error) {
|
||||
|
||||
@@ -619,6 +619,7 @@ test(
|
||||
"retry with permission prompts should populate subscriptions",
|
||||
);
|
||||
} finally {
|
||||
manager.reset();
|
||||
relayManager.setEntries(originalRelayEntries, { allowEmpty: false, updateClient: false });
|
||||
nostrClient.relays = originalRelays;
|
||||
nostrClient.writeRelays = originalWriteRelays;
|
||||
|
||||
Reference in new issue
Block a user