Skip to content

Conversation

@Leonabcd123
Copy link
Contributor

Description

Fixes the following bug:

  • Create tag
  • Go to account page
  • Add that tag to some result
  • Delete the tag
  • Go back to account page
  • Notice that it still thinks that the test has a tag

@monkeytypegeorge monkeytypegeorge added the frontend User interface or web stuff label Jan 9, 2026
Miodec
Miodec previously approved these changes Jan 10, 2026
@github-actions github-actions bot added the waiting for update Pull requests or issues that require changes/comments before continuing label Jan 10, 2026
@github-actions
Copy link
Contributor

Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.

@github-actions github-actions bot removed the waiting for update Pull requests or issues that require changes/comments before continuing label Jan 11, 2026
@Leonabcd123 Leonabcd123 requested a review from Miodec January 11, 2026 16:45
@github-actions github-actions bot added the waiting for review Pull requests that require a review before continuing label Jan 11, 2026
@Miodec Miodec requested a review from Copilot January 14, 2026 20:00
@github-actions github-actions bot added waiting for review Pull requests that require a review before continuing and removed waiting for review Pull requests that require a review before continuing labels Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where deleted tags remained referenced in test results. When a user deleted a tag and returned to the account page, the test results would still show the deleted tag as associated with them.

Changes:

  • Added deleteLocalTag function to remove tag references from all results in the snapshot
  • Integrated the cleanup function into the tag deletion flow to ensure results are updated when tags are deleted

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
frontend/src/ts/db.ts Added deleteLocalTag function that iterates through all results and removes references to the deleted tag
frontend/src/ts/modals/edit-tag.ts Integrated call to deleteLocalTag in the tag removal modal's execution flow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return;
}

export async function deleteLocalTag(tagId: string): Promise<void> {
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is declared as async but doesn't contain any asynchronous operations. Consider removing the async keyword to accurately reflect the function's synchronous nature. This would also allow callers to use it without await.

Suggested change
export async function deleteLocalTag(tagId: string): Promise<void> {
export function deleteLocalTag(tagId: string): void {

Copilot uses AI. Check for mistakes.
Comment on lines 134 to +136
void Settings.update();

await DB.deleteLocalTag(tagId);
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider calling deleteLocalTag before Settings.update() to ensure the snapshot is fully cleaned up before the UI is updated. This would make the state consistent at the time Settings.update() reads it.

Suggested change
void Settings.update();
await DB.deleteLocalTag(tagId);
await DB.deleteLocalTag(tagId);
void Settings.update();

Copilot uses AI. Check for mistakes.
Comment on lines +878 to +885
export async function deleteLocalTag(tagId: string): Promise<void> {
getSnapshot()?.results?.forEach((result) => {
const tagIndex = result.tags.indexOf(tagId);
if (tagIndex > -1) {
result.tags.splice(tagIndex, 1);
}
});
}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding test coverage for the deleteLocalTag function to verify it correctly removes tag references from all results. This would help prevent regressions of the bug being fixed here.

Copilot uses AI. Check for mistakes.
@Miodec Miodec added waiting for update Pull requests or issues that require changes/comments before continuing and removed waiting for review Pull requests that require a review before continuing labels Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for update Pull requests or issues that require changes/comments before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants