Draft: Update to patch report urn parsing minds#3196
Ticket(s) / Related Merge Requests
minds#3196
Summary of Changes
It appears from the example of a report URN from a broken report that somewhere a -1
value is being set -
If you look at the URN of a failing report, you can see there is a double dash, meaning the function changed is incorrectly parsing it urn:report:(urn:user:1348438573400985611)-8--1-1646931982
(between the 8 and 1)
This CAN be replicated by setting a report manually into the DB with the value -1 (see testing considerations), so I feel it's likely the case.
This may be getting set by Javascript but I've been unable to determine where - digging deeper would require adding diagnostic logging to mobile, web and the engine to try to pinpoint the location - unless this is a common occurance, I recommend against investing the time on this as the last report this happened for that I'm aware of seems to be March.
The fix here @fausto.arci suggested as patch.
Testing Considerations
Due to effort replication of the issue in sandbox may not be feasible. The most important thing to test is that reports can be correctly overturned and upheld correctly, which is where the primary regression scope lies.
If you're feeling brave, you could Insert into the sandbox cluster cassandra database the below, replacing all values with valid ones for sandbox (this is from my local)
INSERT INTO minds.moderation_reports (entity_urn, reason_code, sub_reason_code, timestamp, entity_owner_guid, reports, state, user_hashes) VALUES ('urn:user:1286984596277170190', 7, -1, 1655989420000, 1286984596277170190, {1325416809456734220}, 'reported', {'708382649bc59e538b0d17dcded1f0e70a358cd4cb9c55606a61d6bfb1934ed1'});
And try overturning the report.
Deployment Considerations
Standard deployment - if we don't want this fix, consider patching the database
To assess if this fix is needed, we could try to count report sub reasons in the DB less than 1, AND/OR find when the last occurance was.
Regression Scope
Admin report queue.
Platform Affected (web, mobile, etc)
Web
Developer Testing Completed
Manual
Screenshots / Screen Recording
As mentioned in testing considerations, screenshotting this on sandbox may not be possible.
Does this impact
-
Localization -
Dark/light mode -
Guest mode
Definition of Done Checklist
-
The Acceptance Criteria has been met -
Code is tested: Testing includes unit/spec, E2E/automated and manual testing -
Merge requests description has been filled out