Skip to content

fix: allow users to remove topics from verification requests#2216

Merged
caneppelevitor merged 3 commits intostagefrom
fix/2195-remove-topics-bug
Feb 9, 2026
Merged

fix: allow users to remove topics from verification requests#2216
caneppelevitor merged 3 commits intostagefrom
fix/2195-remove-topics-bug

Conversation

@LuizFNJ
Copy link
Collaborator

@LuizFNJ LuizFNJ commented Feb 5, 2026

Description

This PR fixes a bug where removing topics from Verification Requests was failing.

The Problem:

The removal logic was filtering topics based only on the topic.value property. While this worked for Sentences and Images (where topics are stored as objects), it failed for Verification Requests because the data structure differs across these collections.

The Fix:

I updated the filter logic to handle both data structures by checking both topic.value and topic.wikidataId. This ensures the removal functionality is compatible with:

  1. ManualTopic objects (used in Sentences and Images).
  2. Normalized Topic entities (used in Verification Requests).

Technical Debt:

During this fix, I discovered an inconsistency in how topics are stored across the platform (Object IDs vs. Inline Objects). I have added proper TypeScript typing for both cases and created a dedicated issue #2215 to discuss and standardize this architecture in a future.

Related Ticket #2195
Related Refactor Issue: #2215

Type of change

  • Bug fix (non-breaking change which fixes an issue)

#Testing
To verify the fix, please test the topic removal in the following three areas:

  1. Sentence Page: Add and remove topics -> Refresh -> Verify removal.
  2. Image Report: Add and remove topics -> Refresh -> Verify removal.
  3. Verification Request: Add and remove topics -> Refresh -> Verify removal.

Developer Checklist

General

  • Code is appropriately commented, particularly in hard-to-understand areas
  • Repository documentation has been updated (Readme.md) with additional steps required for a local environment setup.
  • No console.log or related logging is added.
  • No code is repeated/duplicated in violation of DRY. The exception to this is for new (MVP/Prototype) functionality where the abstraction layer may not be clear (comments should be added to explain the violation of DRY in these scenarios).
  • Documented with TSDoc all library and controller new functions

Frontend Changes

  • No new styling is added through CSS files (Unless it's a bugfix/hotfix)
  • All types are added correctly

Backend Changes

  • All endpoints are appropriately secured with Middleware authentication
  • All new endpoints have a interface schema defined

Tests

  • All existing unit and end to end tests pass across all services
  • Unit and end to end tests have been added to ensure backend APIs behave as expected

Test IDs

  • Include the test ID when adding new tasks or components.
  • Check that test IDs are present in the modified components.

Merge Request Review Checklist

  • An issue is linked to this PR and these changes meet the requirements outlined in the linked issue(s)
  • High risk and core workflows have been tested and verified in a local environment.
  • Enhancements or opportunities to improve performance, stability, security or code readability have been noted and documented in Project do Github issues if not being addressed.
  • Any dependent changes have been merged and published in downstream modules
  • Changes to multiple services can be deployed in parallel and independently. If not, changes should be broken out into separate merge requests and deployed in order.

@caneppelevitor caneppelevitor merged commit 6c99ad3 into stage Feb 9, 2026
6 of 8 checks passed
@LuizFNJ LuizFNJ moved this from QA to Backlog in AletheiaFact Backlog Feb 9, 2026
@LuizFNJ LuizFNJ mentioned this pull request Feb 25, 2026
46 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants