Files
ssmithx f8b9bbfbe2 fix: Check In/Out button hanging forever with no feedback
Root cause, reproduced live against checkstr.atobitcoin.io with a real
browser: the default relays were bad. wss://relay.damus.io was returning
503 at the WS handshake, and wss://nos.lol accepted the connection but
silently never sent an OK for a brand-new pubkey's first event -- no
error, just permanent silence. Promise.any over both left the check-in
dialog frozen indefinitely with zero feedback.

- Swap default relays to three that were actually verified (via a raw
  WebSocket test, bypassing any client library) to send an explicit OK
  within a couple seconds for a fresh key: relay.primal.net, offchain.pub,
  relay.nostr.wirednet.jp.
- Add a hard client-side timeout (10s) around every publish, normalizing
  both failure paths (AggregateError from all-relays-rejected, or nothing
  responding at all) into one clear message instead of an indefinite hang.
- Disable the Check In/Check Out buttons and show a pending label while a
  publish is in flight, instead of giving no feedback at all.
2026-11-12 04:07:32 +00:00

69 lines
2.0 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Checkstr</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header>
<h1>Checkstr</h1>
<p class="tagline">Hotel check-in / check-out, backed by Nostr.</p>
</header>
<main>
<section id="setup" class="panel">
<h2>Setup</h2>
<label>
Relays (comma separated)
<input id="relays-input" type="text" placeholder="wss://relay.primal.net,wss://offchain.pub" />
</label>
<label>
Property ID
<input id="property-input" type="text" placeholder="e.g. my-hotel" />
</label>
<label>
Rooms (comma separated)
<input id="rooms-input" type="text" placeholder="101,102,103" />
</label>
<div class="button-row">
<button id="login-extension">Connect Nostr Extension</button>
<button id="login-demo" class="secondary">Use demo key (local only)</button>
</div>
<p id="auth-status" class="muted"></p>
<p class="muted">
"Connect Nostr Extension" uses NIP-07 (Alby, nos2x, etc.) to sign events with your
real identity. "Use demo key" generates a throwaway key stored only in this browser —
fine for trying Checkstr out, not for real guest data.
</p>
</section>
<section id="main" class="panel" hidden>
<div class="main-header">
<h2>Property: <span id="property-label"></span></h2>
<button id="change-setup" class="secondary">Edit setup</button>
</div>
<div id="room-grid" class="room-grid"></div>
<h3>Activity</h3>
<ul id="log-list" class="log-list"></ul>
</section>
</main>
<dialog id="checkin-dialog">
<h3>Check in — Room <span id="checkin-room-label"></span></h3>
<label>
Guest name
<input id="guest-name-input" type="text" placeholder="Guest name" />
</label>
<div class="button-row">
<button id="checkin-confirm">Check In</button>
<button id="checkin-cancel" class="secondary">Cancel</button>
</div>
</dialog>
<script type="module" src="ui.js"></script>
</body>
</html>