feat(downloads): restore sorting and stable availability
Make Service sortable by visible provider labels, keep pointer sorting distinct from column dragging, preserve keyboard sorting, infer active and completed transfers as online, and retain definitive availability across item and package resets. Keep manual extraction and package-status changes out of this selective rebuild.
This commit is contained in:
@@ -8414,7 +8414,7 @@ describe("download manager", () => {
|
||||
expect(snap.settings.providerDailyUsageBytes || {}).toEqual({});
|
||||
});
|
||||
|
||||
it("resets extraction state atomically for selected package items", () => {
|
||||
it("resets extraction state without discarding definitive link availability", async () => {
|
||||
const root = fs.mkdtempSync(path.join(os.tmpdir(), "rd-dm-"));
|
||||
tempDirs.push(root);
|
||||
const session = emptySession();
|
||||
@@ -8470,7 +8470,7 @@ describe("download manager", () => {
|
||||
createStoragePaths(path.join(root, "state"))
|
||||
);
|
||||
|
||||
manager.resetItems(itemIds);
|
||||
await manager.resetItems(itemIds);
|
||||
|
||||
const snapshot = manager.getSnapshot().session;
|
||||
expect(snapshot.packages[packageId]).toEqual(expect.objectContaining({
|
||||
@@ -8486,9 +8486,15 @@ describe("download manager", () => {
|
||||
progressPercent: 0,
|
||||
lastError: "",
|
||||
fullStatus: "Wartet",
|
||||
onlineStatus: undefined
|
||||
onlineStatus: "online"
|
||||
}));
|
||||
}
|
||||
|
||||
await manager.resetPackage(packageId);
|
||||
const packageSnapshot = manager.getSnapshot().session;
|
||||
for (const itemId of itemIds) {
|
||||
expect(packageSnapshot.items[itemId].onlineStatus).toBe("online");
|
||||
}
|
||||
});
|
||||
|
||||
it("does not freeze the scheduler when a reset item's old task is parked in a non-abort-observing await", async () => {
|
||||
|
||||
Reference in New Issue
Block a user