Match ' QRT' in the comment as well as the existing QRT variants#827
Match ' QRT' in the comment as well as the existing QRT variants#827accius merged 5 commits intoaccius:Stagingfrom
Conversation
accius
left a comment
There was a problem hiding this comment.
Thanks for catching this — filtering QRT in any position in the comment is the right call.
A couple of notes on the implementation:
-
Redundant
.toUpperCase()—commentsis already uppercased on the line above (const comments = (...).toUpperCase().trim()), so the.toUpperCase()calls in the condition are unnecessary. -
includes(' QRT')is a bit too broad — it would match any word starting with QRT (e.g. hypothetical" QRTZ"). More importantly, a single regex can replace the entire chain of conditions and handle all positions/punctuation cleanly:
const comments = (s.comments || '').toUpperCase().trim();
if (/\bQRT\b/.test(comments)) return false;This covers standalone QRT, QRT , QRT,, QRT, Now QRT many thanks chasers, etc. — all in one line, with word-boundary safety.
Applies to all three files (usePOTASpots, useSOTASpots, useWWFFSpots).
|
Good point. I also eliminated the extra variable. |
What does this PR do?
Adds another variant of 'QRT' to match a spot comment in POTA, SOTA and WWFF.
..., and of course just after creating the PR, I notice someone in WWFF put 'qrt' in their comments.
I deliberately chose to match against 'QRT', so we would pickup comments that had an end of string, or some kind of punctation following 'QRT'.
I noticed a SOTA spot being shown when the comment string was "Now QRT many thanks chasers".
Type of change
How to test
We don't see spots where the comment includes the string " QRT".
Checklist
server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)var(--accent-cyan), etc.).bak,.old,console.logdebug lines, or test scripts included