@@ -294,6 +294,7 @@ const fetchProxyGetTreatments = async (
294
294
shouldServeDismissible : boolean ,
295
295
showDefaultGate : ShowGateValues ,
296
296
gateDisplayCount : number ,
297
+ hideSupportMessagingTimestamp : number | undefined ,
297
298
) : Promise < AuxiaProxyGetTreatmentsResponse > => {
298
299
// pageId example: 'money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software'
299
300
const articleIdentifier = `www.theguardian.com/${ pageId } ` ;
@@ -319,6 +320,7 @@ const fetchProxyGetTreatments = async (
319
320
shouldServeDismissible,
320
321
showDefaultGate,
321
322
gateDisplayCount,
323
+ hideSupportMessagingTimestamp,
322
324
} ;
323
325
const params = {
324
326
method : 'POST' ,
@@ -393,6 +395,32 @@ const incrementGateDisplayCount = () => {
393
395
storage . local . setRaw ( 'gate_display_count' , newCount . toString ( ) ) ;
394
396
} ;
395
397
398
+ const decideHideSupportMessagingTimestamp = ( ) : number | undefined => {
399
+ // Date: 1 September 2025
400
+ //
401
+ // This cookie is overloaded in the following way:
402
+ // If the user has performed single contribution, then the value is the
403
+ // timestamp of the event. But if the user has performed a recurring
404
+ // contribution, then the value is a future timestamp.
405
+ //
406
+ // Ideally we would correct the semantics of the cookie, but for the moment
407
+ // we are simply going to ignore the value if it's in the future. We
408
+ // are making this adjustment here, but will also mirror it in SDC
409
+
410
+ const rawValue : string | null = storage . local . getRaw (
411
+ 'gu_hide_support_messaging' ,
412
+ ) ;
413
+ if ( rawValue === null ) {
414
+ return undefined ;
415
+ }
416
+ const timestamp = parseInt ( rawValue , 10 ) ;
417
+ const now = Date . now ( ) ; // current time in milliseconds since epoch
418
+ if ( Number . isInteger ( timestamp ) && timestamp < now ) {
419
+ return timestamp ;
420
+ }
421
+ return undefined ;
422
+ } ;
423
+
396
424
const buildAuxiaGateDisplayData = async (
397
425
contributionsServiceUrl : string ,
398
426
pageId : string ,
@@ -434,6 +462,8 @@ const buildAuxiaGateDisplayData = async (
434
462
const showDefaultGate = decideShowDefaultGate ( ) ;
435
463
const gateDisplayCount = getGateDisplayCount ( ) ;
436
464
465
+ const hideSupportMessagingTimestamp = decideHideSupportMessagingTimestamp ( ) ;
466
+
437
467
const response = await fetchProxyGetTreatments (
438
468
contributionsServiceUrl ,
439
469
pageId ,
@@ -452,6 +482,7 @@ const buildAuxiaGateDisplayData = async (
452
482
shouldServeDismissible ,
453
483
showDefaultGate ,
454
484
gateDisplayCount ,
485
+ hideSupportMessagingTimestamp ,
455
486
) ;
456
487
457
488
if ( response . status && response . data ) {
0 commit comments