Skip to content

webapp: show the dispute period and its end, and sign it - #27

Closed
evgeny-simplex wants to merge 79 commits into
simplex-chat:namesfrom
evgeny-simplex:ep/webapp-dispute-days
Closed

evgeny-simplex wants to merge 79 commits into
simplex-chat:namesfrom
evgeny-simplex:ep/webapp-dispute-days

Conversation

@evgeny-simplex

@evgeny-simplex evgeny-simplex commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #23 (Alain's commits kept), with names merged.

Follows simplex-network/ens-contracts#51, merged on simplex as ebf7698: the sponsor's RegisterName type has uint256 disputeDays before the nonce, and each sponsored registration has a dispute period of 14 to 120 days, during which the registration can be ended (unregister: expiry 0, the name available to anyone at once). On names, every registration this page signs reverts on those contracts. The names service's side is simplex-chat/simplex-chat#8278 (into names), which adds disputeDays, disputeUntil and the phase ended to the registration view, and disputeDays to its balance; an ended order's view has expiresAt and disputeUntil null.

Signing (src/crypto/registration.ts, src/flow.ts)

  • RegisterName with disputeDays between data and nonce; the reveal signs the view's disputeDays.

Service view (src/api.ts, src/session.ts, src/store.ts)

  • disputeDays, an integer of 14 to 120; disputeUntil, unix seconds or null; the phase ended.
  • A balance's disputeDays, 14 to 120, required: the dispute days of an order paid from that balance. The page keeps them with the balance it pays with; a balance an older page kept without them is not taken: the tab's balance is none, and a checkout holding one is a leftover, as a checkout without its terms is.
  • Payment, the way an order is paid (a method, a code or a balance alone), is the type of a record's method. DISPUTE_DAYS holds the days of a card (120), Bitcoin, Monero and a code (14). Paid is a method or a code, or a balance's days with the method of the rest, or none; allowedDays(paid) returns the days allowed for it: the method's or the code's, or, from a balance, the balance's days, or the rest's method's when more.

Check your order (src/views/checkout.ts, src/screens/checkout.ts, src/styles.css)

  • A row "Dispute period" under "Registered until", "{N} days", whose hint on hover, focus or tap says "For {N} days after it is registered, the registration can be ended if a payment for it is disputed, reversed or refunded in full.": 120 for a card; 14 for Bitcoin, Monero or a prepaid code; paid from a balance, the balance's disputeDays, or those of the way to pay the rest when more. The row is drawn with the review's first frame, from the balance as the tab took it. Once the balance is spent on an order of this name whose answer was lost, the row is left out: Open your order opens that order, which is signed for the balance's days.
  • One function, paidOf, returns how the review's order is paid, with the balance's days when a balance pays; the row's days are allowed for it. paymentOf returns its way to pay, for the payment choices, the wait for a card order Stripe has not confirmed, Pay's label and the words of an earlier try's invoice opened instead.
  • The review is drawn compactly in every state, as it was with a refusal's line; a review holding a line draws its order's row as tall as its content and its rows at a line height of 1.3, so that the review with the Dispute period row fits a laptop's frame when this name's own order holds the balance or took it (the terms' box was drawn under Pay before).
  • A name of more than 25 letters is written in the card and in the line about the balance as its first 12 letters, "..." and its last 3, with the whole name for screen readers (shortName in src/dom.ts; for the card's row, shortRowName in src/views/terms.ts, which returns the name as drawn with the whole name beside it).
  • On a touch screen, I have a code stands 12 px under the payment methods, so its tap area stays off their cards.

Order page (src/views/order.ts, src/screens/order.ts, src/flow.ts, src/format.ts)

  • The page signs no reveal whose disputeDays exceeds what the order's payment allows: 120 for a card, 14 for Bitcoin, Monero or a code, and, for an order paid from a balance, the disputeDays of that balance, or those of the way the rest is paid when more. The payment is taken from this browser's record of the order, never from the view's fromBalance: an order made in this browser without a balance is allowed its own method's days, whatever balance the service's view or find names. A record made here keeps its payment when the order is reopened with its code: an order of the code met by a new order of its name, a newer order of a forgotten one, Check your code, a restore. A code order is allowed a code's 14 days, whatever balance find names for it. A record of an order made in another browser, restored or adopted here, holds the payment the service reported; for an order adopted here, the order its balance came from and its creation time are read from one find, and while find fails, the order stays unadopted until the next read. For an order paid from a balance, the balance's days are the service's report, read from the view of the order it came from only when the view's days exceed the least that payment is allowed: 14 for a balance alone, or the days of the way the rest is paid. An order paid from a balance that find does not name, or that is missing from the view of the order it came from, is not signed, and its reveal is tried again. In place of a reveal over more days, the page says "This order cannot be signed" / "Its registration could be ended for {days} days, longer than the {allowed} days its payment allows. Write to chat@simplex.chat with the reference below.", without the lead to keep the page open, and announces it to screen readers. Such a reveal is signed once the service's view gives other days, as the reveal's key includes them. Your names keeps "Open to finish" for such an order; opening it shows the notice with its reference.
  • A registered order before its dispute end: "It can be ended until {date} if a payment for it is disputed, reversed or refunded in full." The sentence is removed when that time passes on an open page.
  • An ended order: "Registration ended", with the code action in codes-only mode and Search a name otherwise. An open page stops reading a registered order, so it shows the order ended when it is next opened.
  • In the Use in the app card, a name of more than 25 letters is written as its first 12 letters, "..." and its last 3, so that the page fits a phone's frame; screen readers get the whole name, and the heading keeps it.

Your names, Edit links (src/screens/names.ts, src/views/names.ts, src/screens/search.ts, src/flow.ts)

  • An ended order: the chip Ended; Edit links: "The registration was ended". The page takes an order as ended only from the service's view, which the service sets at its hourly check of the chain; until then the order shows as registered.
  • Until that check, a registered order whose name the search does not answer as registered, as after an unregister, has no Edit links in Your names, and Edit links shows "The name could not be read now" and reads the name again every 5 seconds.
  • An ended order is not taken as an open order for its name, nor chosen to reopen.

Dev backend (dev/, README.md)

  • The dev chain deploys ens-contracts at ebf7698.
  • The mock gives each order the dispute days of its payment, as the service does (orderDisputeDays in Store.hs): 120 for a card; 14 for Bitcoin, Monero or a prepaid code; for an order paid from a balance, that balance's days, or the way to pay the rest's when more. Each balance in its view has dispute days: those of its order, or, for an order closed unpaid, those of its invoice. The mock checks each reveal's RegisterName signature over the order's days and relays them to the sponsor, reads the registrar's disputeUntil, and ends a registration with /control/unregister/<registration>, after which the order's view has expiresAt and disputeUntil null. The seeded names and the rival registrations of /control/take are signed with 120 days.

Tests

  • Unit: the digest against viem's hashTypedData, the view's and the balance's parsing, the order, names, search and checkout screens, paymentOf and allowedDays, the days by way to pay and from a balance's days, none once this name's own order took the balance, the reveal's check of a balance's days and its retry, an order made here without a balance refused over its method's days whatever balance the view and find name, also once its code reopens it, a reveal declined for its days signed once the view gives other days, a balance alone signed at 14 days without a read, Edit links and Your names for a registered order whose name the search answers available or reserved, a balance or checkout an older page kept without days, the label abbreviation.
  • Browser: registration with a code and through the contracts, a reveal signed over other dispute days refused, the mock's balance days by the payment they came from, the Dispute period row by way to pay, a balance and a code, drawn before the balance is read again, left out once this name's own order took the balance, its hint as the button's description and on hover, a reveal over more days than the payment's not signed and announced, a difference order adopted by another browser signed there for its card balance's 120 days, codes-only mode, an ended order, a dispute end that passes, the whole name for screen readers and its abbreviation drawn, a long name's chats at the row's right, the review fitting both windows while this name's own order holds the balance or took it, I have a code's tap area on a touch screen.
  • Screenshots: Check your order in each state with its Dispute period row, and without it once this name's own order took the balance, the registered states with a dispute end, a reveal not signed for its days, the ended order, the Ended row and the ended Edit links.

CI
At f04f3f7, the head, in the fork run https://github.com/brenzi-agent/simplex.domains/actions/runs/44883416305, whose failed jobs ran again at the same commit:

The six pushes of this round, the last of f04f3f7, started no PR build: since 5c03bd9 (#19) on names, the pull request has a merge conflict, and GitHub's documentation of the pull_request event states "Workflows will not run on pull_request activity if the pull request has a merge conflict." (https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request). The last PR build is https://github.com/simplex-chat/simplex.domains/actions/runs/44818655877, at 83b56c6.

The new tests of this round fail at 8e14819 (2c7d641 with the tests) in https://github.com/brenzi-agent/simplex.domains/actions/runs/44882861220 (https://github.com/brenzi-agent/simplex.domains/actions/runs/44882861220/job/136781742290): three of 711 unit tests, a Bitcoin and a code order whose payment a reopen replaced with the service's, and a declined reveal not signed after the view's days changed. Its browser jobs were cancelled, as their code is 2c7d641's.

At the previous head, 2c7d641, in https://github.com/brenzi-agent/simplex.domains/actions/runs/44822792953, Screens failed order-closed-received-offer (14514 px of the laptop image, 17916 px of the phone's), which this paragraph left out then; the base 738189b fails it by the same pixels in https://github.com/brenzi-agent/simplex.domains/actions/runs/44798348583, and f04f3f7 passes it.

The tests failing at f04f3f7, each with the runs in which it fails on the base 738189b, or fails and passes at the same commit:

Open: the merge of names. Since 5c03bd9 (#19), names parses the registration view's phase as an object (isPhase in src/api.ts); the service of simplex-chat/simplex-chat#8278 encodes it as text (viewJSON in View.hs), and that pull request's apps/simplex-domains submodule is pinned to this branch. This branch is kept on the base 738189b until the order of the two changes is decided.

Open: the wording of the ended screens. The ended order's page says "Registration ended" / "The registration of {name} was ended because a payment for it was disputed, reversed or refunded in full.", without "Anyone can register the name now.", because the name can have been registered again since; Your names marks the row "Ended"; Edit links says "The registration was ended" / "A payment for it was disputed, reversed or refunded in full, so this page no longer edits its links."

Merge of names (4d59775), in 8adf004

The conflicts are resolved in the merge commit; Alain's commits are unchanged. Where this description and the merge differ, the merge holds:

  • Balance payments are removed, as on names: the owner ruled on 21 November that a balance pays for no other order. Removed: a balance's disputeDays, a record's method "balance", Paid, allowedDays, paidOf, paymentOf, the spend tests, and the balance screens (the 22 checkout-review-balance-* baselines, order-taken-balance-order and order-reorder-balance-in-use). A balance is {amount, refunded}.
  • The registration view, as agreed with the rework of store: dispute days by payment, and ended names simplex-chat#8278:
    • phase is an object, as on names;
    • disputeDays at the top level, an integer of 14 to 120, from the order's payment;
    • registered is {type, expiresAt, disputeUntil?}, disputeUntil absent when the registrar holds none, as failed's heldUntil is;
    • ended is {type: "ended"}.
  • Signing: the page signs at order time over the days of the payment chosen (Draft.disputeDays); a name selected for a taken order is signed over the days of the order's own payment; a later signature (revealFor) is refused when the view's days exceed those of the payment in this browser's record. The service computes the digest over its own days for that payment, so other days are refused as bad_request.
  • The paid-order test of a reveal over more days (paid.spec.ts) and the screen order-registering-days-refused make the service ask for a new signature (/control/stale), as on names an order is signed when it is placed.
  • Check your order keeps this branch's compact styles in every state; the 46 checkout-review-* baselines are names', and CI records them with the Dispute period row.
  • The checkout-select-* screens of names gain the Dispute period row, the compact spacing and, for a name of more than 25 letters, its abbreviation in the card; names-row-ended takes names' "Free name with a code".
  • A registered order whose name the search answers as available before its expiry reads as unregistered, as on this branch: Your names offers no Edit links for it, and Edit links reads the name again.

Tests at 8adf004, locally:

  • tsc passes.
  • Unit: 603 passed, 54 skipped. The skipped contract tests (test/contract, test/terms-vectors.test.ts) run on the service's recorded fixtures.
  • Contract tests at 081069e on the fixtures of the #8278 rework (simplex-chat 7aa69544d, tests/fixtures/store-service/rest-api): 64 passed. They read a registered order's dispute end, one registered without a dispute end, an ended order, and the RegisterName digests over a card's 120 and a code's 14 days.
  • Chromium browser tests against the mock and ens-contracts ebf7698: 356 passed, 11 skipped.

brenzi-agent and others added 26 commits November 20, 2026 18:57
# Conflicts:
#	webapp/README.md
#	webapp/dev/mock.ts
#	webapp/dev/mock/service.ts
#	webapp/e2e/balance.spec.ts
#	webapp/e2e/codes.spec.ts
#	webapp/e2e/contract.spec.ts
#	webapp/e2e/helpers.ts
#	webapp/e2e/screens.spec.ts
#	webapp/e2e/screens/checkout-review-balance-changed-desktop.png
#	webapp/e2e/screens/checkout-review-balance-changed-phone.png
#	webapp/e2e/screens/checkout-review-balance-covers-desktop.png
#	webapp/e2e/screens/checkout-review-balance-covers-phone.png
#	webapp/e2e/screens/checkout-review-balance-gone-desktop.png
#	webapp/e2e/screens/checkout-review-balance-gone-phone.png
#	webapp/e2e/screens/checkout-review-balance-held-named-confirming-desktop.png
#	webapp/e2e/screens/checkout-review-balance-held-named-confirming-phone.png
#	webapp/e2e/screens/checkout-review-balance-held-named-desktop.png
#	webapp/e2e/screens/checkout-review-balance-held-named-phone.png
#	webapp/e2e/screens/checkout-review-balance-held-this-name-desktop.png
#	webapp/e2e/screens/checkout-review-balance-held-this-name-phone.png
#	webapp/e2e/screens/checkout-review-balance-held-unnamed-confirming-desktop.png
#	webapp/e2e/screens/checkout-review-balance-held-unnamed-confirming-phone.png
#	webapp/e2e/screens/checkout-review-balance-held-unnamed-desktop.png
#	webapp/e2e/screens/checkout-review-balance-held-unnamed-phone.png
#	webapp/e2e/screens/checkout-review-balance-part-coin-only-desktop.png
#	webapp/e2e/screens/checkout-review-balance-part-coin-only-phone.png
#	webapp/e2e/screens/checkout-review-balance-part-desktop.png
#	webapp/e2e/screens/checkout-review-balance-part-phone.png
#	webapp/e2e/screens/checkout-review-balance-took-own-order-desktop.png
#	webapp/e2e/screens/checkout-review-balance-took-own-order-phone.png
#	webapp/e2e/screens/checkout-review-bonus-tip-desktop.png
#	webapp/e2e/screens/checkout-review-bonus-tip-phone.png
#	webapp/e2e/screens/checkout-review-btc-desktop.png
#	webapp/e2e/screens/checkout-review-btc-phone.png
#	webapp/e2e/screens/checkout-review-busy-desktop.png
#	webapp/e2e/screens/checkout-review-busy-phone.png
#	webapp/e2e/screens/checkout-review-card-desktop.png
#	webapp/e2e/screens/checkout-review-card-phone.png
#	webapp/e2e/screens/checkout-review-chat-popup-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-expired-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-expired-phone.png
#	webapp/e2e/screens/checkout-review-code-refused-invalid-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-invalid-phone.png
#	webapp/e2e/screens/checkout-review-code-refused-not-covering-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-not-covering-phone.png
#	webapp/e2e/screens/checkout-review-code-refused-reserved-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-reserved-phone.png
#	webapp/e2e/screens/checkout-review-code-refused-unpaid-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-unpaid-phone.png
#	webapp/e2e/screens/checkout-review-code-refused-used-desktop.png
#	webapp/e2e/screens/checkout-review-code-refused-used-phone.png
#	webapp/e2e/screens/checkout-review-community-desktop.png
#	webapp/e2e/screens/checkout-review-community-phone.png
#	webapp/e2e/screens/checkout-review-community-popup-desktop.png
#	webapp/e2e/screens/checkout-review-hold-desktop.png
#	webapp/e2e/screens/checkout-review-hold-phone.png
#	webapp/e2e/screens/checkout-review-links-desktop.png
#	webapp/e2e/screens/checkout-review-links-phone.png
#	webapp/e2e/screens/checkout-review-links-unread-desktop.png
#	webapp/e2e/screens/checkout-review-links-unread-phone.png
#	webapp/e2e/screens/checkout-review-method-unavailable-desktop.png
#	webapp/e2e/screens/checkout-review-method-unavailable-phone.png
#	webapp/e2e/screens/checkout-review-open-order-confirming-desktop.png
#	webapp/e2e/screens/checkout-review-open-order-confirming-phone.png
#	webapp/e2e/screens/checkout-review-open-order-desktop.png
#	webapp/e2e/screens/checkout-review-open-order-phone.png
#	webapp/e2e/screens/checkout-review-sending-desktop.png
#	webapp/e2e/screens/checkout-review-sending-phone.png
#	webapp/e2e/screens/checkout-review-term-started-desktop.png
#	webapp/e2e/screens/checkout-review-term-started-phone.png
#	webapp/e2e/screens/checkout-review-terms-changed-desktop.png
#	webapp/e2e/screens/checkout-review-terms-changed-phone.png
#	webapp/e2e/screens/checkout-review-unticked-desktop.png
#	webapp/e2e/screens/checkout-review-unticked-phone.png
#	webapp/e2e/screens/checkout-review-xmr-desktop.png
#	webapp/e2e/screens/checkout-review-xmr-phone.png
#	webapp/e2e/track.spec.ts
#	webapp/src/api.ts
#	webapp/src/flow.ts
#	webapp/src/screens/checkout.ts
#	webapp/src/screens/names.ts
#	webapp/src/screens/order.ts
#	webapp/src/screens/search.ts
#	webapp/src/session.ts
#	webapp/src/store.ts
#	webapp/src/styles.css
#	webapp/src/views/checkout.ts
#	webapp/src/views/names.ts
#	webapp/src/views/order.ts
#	webapp/test/api.test.ts
#	webapp/test/flow.test.ts
#	webapp/test/rules.test.ts
#	webapp/test/screens-checkout.test.ts
#	webapp/test/screens-names.test.ts
#	webapp/test/screens-order.test.ts
#	webapp/test/screens-search.test.ts
#	webapp/test/session.test.ts
#	webapp/test/terms-vectors.test.ts
…e's dispute days as the service records them
@epoberezkin
epoberezkin marked this pull request as ready for review November 23, 2026 09:16
epoberezkin pushed a commit to simplex-chat/simplex-chat that referenced this pull request Nov 23, 2026
* docs: plan the dispute days of names registrations

* store: add dispute days to name orders and intents, with tests

* store: sign and register names over the dispute days of their payment

* store: document the dispute days of name orders

* store: add the ended phase of name orders, with tests

* store: show a name registration ended in its dispute period as ended

* store: document the ended phase of name orders

* store: answer the registrar's dispute end in the close test

* store: read zero chain times as none in one place

* store: test name dispute reads against the confirmed block

* store: end no name on a chain read from before its registration

* store: end a name unregistered within the confirmation depth

* store: show no expiry or dispute end for an ended name

* store: keep ended names readable after the down migration

* store: set dispute days by payment kind, not by contract bounds

* store: correct the docs of name dispute days and ended orders

* store: record test registers mined at the fixture's confirmed block

* store: test a landing read that finds another registration of the name

* store: end an order whose landing read finds another registration

* store: build the names site that signs and shows dispute days

* store: name the ended phase and sweep in the worker's comments

* store: correct the names docs on landings, roles, links and contracts

* store: name the webapp of the dev contract run's cases

* store: build the names site at the web store's final dispute days head

* store: test balance days, ended orders, close answers and sweep reads

* store: state the dispute days of a balance in its view

* store: keep an ended order's own dispute end, and answer //close so

* store: read the ended sweep's other orders past one failed read

* store: read a commit block's time as a register block's is read

* store: document balance days, ended orders' rows, sweep reads and gas

* store: point the names doc's links at the code they name

* store: word the dispute days docs with the data acted upon

* store: read a reverted edit's block time as a register block's is read

* store: test the ended sweep past a failed read with orders it reads

* store: build the names site that reads a balance's dispute days

* store: test a balance's dispute days by their values

* store: test ended orders' own expiry, Try again, moves and log lines

* store: keep the expiry an ended order's register set

* store: state a register check's outcome as one sum

* store: log each order set ended with the dispute end read

* store: track the names branch of the names site

* store: state each answer to an unconfirmed register and the gas of disputes

* store: restore the space in the answer of //close for an ended order

* store: wrap the dispute days check of a lost register receipt

* store: build the names site that limits days by the recorded payment

* store: state a lost receipt's taken outcome and the dispute write's gas

* store: point the names doc's edited links at their code at the head

* store: keep the names doc's other links on the code they named before

* store: test that the ended sweep's failed read names its order

* store: name the order of the ended sweep's failed read

* store: word the ends and payments of the dispute docs as acted upon

* store: point the names doc's edited links at the code their text names

* store: dispute days by payment, and ended names

On the order model of #8243: an order's dispute days are set by its
payment (card 120, BTC, XMR and codes 14) and stored in dispute_days;
RegisterName and registerWithCredit include them, and a reveal signed over
other days is refused. A register is checked at the confirmed block only
once that block reaches it, and an order whose disputeUntil(id) there is
not its register's own end is set ended. An hourly sweep sets ended each
registered order whose registration was ended in its dispute period,
with a last-completed-pass gauge. The view gains disputeDays,
registered's disputeUntil and the phase ended; fixtures are recorded.

* store: the Postgres schema dump with the dispute columns

* store: pin the names page that signs dispute days and shows ended names

apps/simplex-domains at 081069e, the head of simplex-chat/simplex.domains#27; moved to #27's merge commit on names once it merges.

* store: the contract run leaves out the page cases of an ended registration and a refused reveal, which need the mock's controls

* store: pin the names page at #23's head, excluding its mock-only cases

* store: the contract run leaves out #23's two Bitcoin reveal cases, which drop the signed reveal with the mock's /control/stale

* store: confirmedBlock is read in Orders, and deepBlock stays in Records

* store: pin the names page at #23's head 55a0b0e, which drops the two Bitcoin reveal cases the contract run left out

* store: pin the names page at #23's merge commit c13bce0 on names

---------

Co-authored-by: brenzi-agent <346870783+brenzi-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants