@@ -294,6 +294,7 @@ const fetchProxyGetTreatments = async (
294294 shouldServeDismissible : boolean ,
295295 showDefaultGate : ShowGateValues ,
296296 gateDisplayCount : number ,
297+ hideSupportMessagingTimestamp : number | undefined ,
297298) : Promise < AuxiaProxyGetTreatmentsResponse > => {
298299 // pageId example: 'money/2017/mar/10/ministers-to-criminalise-use-of-ticket-tout-harvesting-software'
299300 const articleIdentifier = `www.theguardian.com/${ pageId } ` ;
@@ -319,6 +320,7 @@ const fetchProxyGetTreatments = async (
319320 shouldServeDismissible,
320321 showDefaultGate,
321322 gateDisplayCount,
323+ hideSupportMessagingTimestamp,
322324 } ;
323325 const params = {
324326 method : 'POST' ,
@@ -393,6 +395,32 @@ const incrementGateDisplayCount = () => {
393395 storage . local . setRaw ( 'gate_display_count' , newCount . toString ( ) ) ;
394396} ;
395397
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+
396424const buildAuxiaGateDisplayData = async (
397425 contributionsServiceUrl : string ,
398426 pageId : string ,
@@ -434,6 +462,8 @@ const buildAuxiaGateDisplayData = async (
434462 const showDefaultGate = decideShowDefaultGate ( ) ;
435463 const gateDisplayCount = getGateDisplayCount ( ) ;
436464
465+ const hideSupportMessagingTimestamp = decideHideSupportMessagingTimestamp ( ) ;
466+
437467 const response = await fetchProxyGetTreatments (
438468 contributionsServiceUrl ,
439469 pageId ,
@@ -452,6 +482,7 @@ const buildAuxiaGateDisplayData = async (
452482 shouldServeDismissible ,
453483 showDefaultGate ,
454484 gateDisplayCount ,
485+ hideSupportMessagingTimestamp ,
455486 ) ;
456487
457488 if ( response . status && response . data ) {
0 commit comments