| Server IP : 216.92.14.13 / Your IP : 216.73.217.126 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/home/rmlac2fmr/ |
Upload File : |
#!/usr/bin/env python3
"""
Check whether transpoLastPushedAt is persisted to db.json after push.
Read-only diagnostic.
"""
import json
import os
import sys
candidates = ['db.json', './data/db.json', os.path.expanduser('~/public_html/jn.com/ops/data/db.json')]
db_path = next((c for c in candidates if os.path.exists(c)), None)
if not db_path: print("ERROR: db.json not found"); sys.exit(1)
with open(db_path, 'r') as f:
db = json.load(f)
print(f"Reading: {db_path}\n")
# Show-level timestamp
print("=" * 70)
print("SHOW-LEVEL: lastTranspoPush")
print("=" * 70)
for s in db.get('shows', []):
code = s.get('code', s.get('id'))
pushed = s.get('lastTranspoPush', '(never)')
print(f" {code} ({s.get('id')}): lastTranspoPush = {pushed}")
# Request-level timestamps
print("\n" + "=" * 70)
print("TRAVEL REQUEST: transpoLastPushedAt + bd.lastModified")
print("=" * 70)
print("(showing first 20 with status=purchased/complete/selfbook)")
reqs = [r for r in db.get('travelRequests', [])
if r.get('status') in ('purchased', 'complete', 'selfbook')]
print(f"\nTotal eligible requests: {len(reqs)}")
print(f"Eligible with transpoLastPushedAt set: {sum(1 for r in reqs if r.get('transpoLastPushedAt'))}")
print(f"Eligible WITHOUT transpoLastPushedAt: {sum(1 for r in reqs if not r.get('transpoLastPushedAt'))}")
print()
for r in reqs[:25]:
pid = r.get('personId', '')
p = next((x for x in db.get('persons', []) if x.get('id') == pid), {})
name = f"{p.get('firstName','')} {p.get('lastName','')}".strip() or '(?)'
show = r.get('showId', '')
pushed = r.get('transpoLastPushedAt', '(NEVER STAMPED)')
bd = r.get('bookingDetails', {}) or {}
last_mod = bd.get('lastModified', '(none)')
# What would isNew evaluate to?
is_new = (not r.get('transpoLastPushedAt')) or (
last_mod != '(none)' and last_mod > r.get('transpoLastPushedAt', '')
)
new_label = '🟡 NEW' if is_new else '✓ pushed'
print(f" [{show}] {name[:25]:<25} push={pushed[:19]} mod={last_mod[:19]} → {new_label}")
# Show whether the deployed code knows about transpoLastPushedAt at all
print("\n" + "=" * 70)
print("VERIFY DEPLOYED FILES")
print("=" * 70)
server_path = os.path.expanduser('~/public_html/jn.com/ops/server/index.js')
if os.path.exists(server_path):
with open(server_path, 'r') as f:
content = f.read()
has_stamp = 'transpoLastPushedAt' in content
print(f" server/index.js: transpoLastPushedAt {'PRESENT' if has_stamp else 'MISSING'}")
if has_stamp:
# Count occurrences
cnt = content.count('transpoLastPushedAt')
print(f" ({cnt} occurrences)")
else:
print(f" server/index.js: NOT FOUND at {server_path}")
html_path = os.path.expanduser('~/public_html/jn.com/ops/public/index.html')
if os.path.exists(html_path):
with open(html_path, 'r') as f:
content = f.read()
has_stamp = 'transpoLastPushedAt' in content
print(f" public/index.html: transpoLastPushedAt {'PRESENT' if has_stamp else 'MISSING'}")
if has_stamp:
cnt = content.count('transpoLastPushedAt')
print(f" ({cnt} occurrences)")
else:
print(f" public/index.html: NOT FOUND at {html_path}")