You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening an existing file and adding a new passage, the passage counter incorrectly recounts all existing passages in the file, causing the counter to increase more than it should. Instead of incrementing by 1 (for the new passage), the counter includes all the passages in the newly opened file again, resulting in an inflated passage count.
Steps to Reproduce
Open a file that already contains passages.
Observe the passage counter (e.g., Passage Count: 10).
Add a new passage to the file.
Check the passage counter again.
Expected Behavior
The passage counter should increment by 1 to reflect the addition of the new passage (e.g., from Passage Count: 10 to Passage Count: 11).
Actual Behavior
The passage counter increases by the number of existing passages in the file plus 1. For example:
If there are 10 passages in total and a file with 3 unopened passages is opened, then adding a single passage causes the counter to jump to 14 instead of 11. See the attachments for proof.
Fix
I will work on the fix, I could do it "dirty" by checking for duplicates when ctx.workspaceState.get("passages", []) as Passage[]; is assigned to a variable. However, this fix is temporary and doesn't fix the underlying problem.
Attachments
GwenMaxine already added on 934 is re-added at 997 after opening the file.tw and adding a new passage to that file.
The text was updated successfully, but these errors were encountered:
Information
When opening an existing file and adding a new passage, the passage counter incorrectly recounts all existing passages in the file, causing the counter to increase more than it should. Instead of incrementing by 1 (for the new passage), the counter includes all the passages in the newly opened file again, resulting in an inflated passage count.
Steps to Reproduce
Expected Behavior
The passage counter should increment by 1 to reflect the addition of the new passage (e.g., from Passage Count: 10 to Passage Count: 11).
Actual Behavior
The passage counter increases by the number of existing passages in the file plus 1. For example:
If there are 10 passages in total and a file with 3 unopened passages is opened, then adding a single passage causes the counter to jump to 14 instead of 11. See the attachments for proof.
Fix
I will work on the fix, I could do it "dirty" by checking for duplicates when
ctx.workspaceState.get("passages", []) as Passage[];
is assigned to a variable. However, this fix is temporary and doesn't fix the underlying problem.Attachments
GwenMaxine
already added on934
is re-added at997
after opening thefile.tw
and adding a new passage to that file.The text was updated successfully, but these errors were encountered: