Show the preferred call time without a consent step first - #1261
Closed
joshuakrueger-dfx wants to merge 2 commits into
Closed
Show the preferred call time without a consent step first#1261joshuakrueger-dfx wants to merge 2 commits into
joshuakrueger-dfx wants to merge 2 commits into
Conversation
The mail that asks a customer for a verification call links to /settings?a=call and tells them to pick a preferred time there. The time dropdown was rendered only while the consent dropdown above it said yes, and that one starts empty for everyone who has never been called - so the customers the mail addresses arrived at the section it pointed them to and found no way to pick a time. More than ten support tickets in the last seven days say exactly that. Render the time dropdown unconditionally. Both fields keep saving themselves independently, as before. A save that fails now shows the reason instead of disappearing as an unhandled rejection.
The screen showed the reason a save failed but left the rejected choice in the dropdown. Picking the same option again changed nothing, so the effect watching that value never ran and no second request went out - the customer was left with an error and no way to retry in place. Put the saved value back when a request fails, so the next choice is a real change again. Each field's error now renders in its own container so a test can tell them apart.
joshuakrueger-dfx
marked this pull request as ready for review
August 4, 2026 11:28
joshuakrueger-dfx
requested review from
TaprootFreak and
davidleomay
as code owners
August 4, 2026 11:28
Contributor
Author
|
Closing this: the reported problem has a different cause. Two support tickets with the account state at the time of reporting show the customers never reached the section at all - the deep link from the mail loses its anchor across the login redirect, so they land on the settings page without being taken to the verification call block. Fix follows in a separate PR against that redirect. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The mail that asks a customer for a verification call links to
app.dfx.swiss/settings?a=callandtells them to pick a preferred time there. On that page the time dropdown was rendered only while
the consent dropdown above it said "Yes, call me":
acceptCallis only pre-filled fromuser.kyc.phoneCallAccepted, and that isnullfor everyonewho has never been called. So the customers the mail addresses arrive at the section it points them
to, see a single dropdown reading
Select..., and have no way to pick a time.More than ten support tickets in the last seven days say exactly that: "I cannot select an
appointment."
Measured in the browser against the Dev API with a freshly created account, before the change: the
"Verification Call" heading and the consent dropdown are visible, the label "Preferred call time"
is not.
Change
Render the time dropdown unconditionally.
Both fields keep saving themselves independently through their own effect, exactly as before — the
consent dropdown sends
acceptCall, the time dropdown sendspreferredPhoneTimes. Nothing iscoupled.
A save that fails now shows the reason via
ErrorHintinstead of disappearing as an unhandledrejection, and the dropdown returns to its saved value so the next choice is a real change again —
otherwise picking the same option twice produced no second request and the customer was stuck with
an error and no way to retry. Each field owns its error state and renders it under itself: with a
single shared state, a failed consent save followed by a successful time save would silently wipe
the message. The context functions in
@dfx.swiss/reactstay untouched: not catching there is theconvention across all of them, the caller is responsible —
transaction.screen.tsxandtfa.screen.tsxuse the same.catch((error: ApiError) => …)one-liner.The time dropdown is the field this change makes reachable for customers without consent; the
consent dropdown was always rendered, so its error path existed before. Both are handled here
because they are the same two lines in the same block.
Verification
a time selection sends only
preferredPhoneTimes, "No, don't call me" still sendsacceptCallalone, each field surfaces its own save error under its own field, a failed save returns the
dropdown to the server value, the same choice afterwards sends another request, and an error
clears when the next save on that field starts.
{acceptCall && …}→ 6 of 11 red;removing the rollback in the consent
catch→ 3 of 11; removing the error resets → 2 of 11;rolling back to the rejected value instead of the saved one → 3 of 11; making the time effect
write into the neighbouring field's error state → 1 of 11.
lint,test,build:dev,widget:dev): lint clean,71 suites / 789 tests passing.
e2e/settings-call-time.spec.tscovers the same visibility check in a real browser against theDev API. Per CONTRIBUTING these specs are a local review aid and do not run in CI.
Deliberately not in this PR
phoneCallStatusisCompletedorFailed. That isexisting, intended behaviour.
phoneCallAccepted. It does not need to —phoneCallAcceptedis only evaluated whenphoneCallStatus === UserRejected, and customers arecalled from the AML reason of their transaction. Their chosen time is visible to the caller in the
user detail panel.
That is pre-existing and unrelated to the visibility bug.
acceptCall, theresponse comes back with
preferredPhoneTimes: []even when times are stored, becausesetUserDataSettingsassignsundefinedonto the entity and the client adopts that responsewithout refetching. Clearing all times right after such a save therefore sends no request. This
was reachable before as well; it is not introduced here.
section (added 2026-03-12, Feat: support improvements #989). Regenerating it would pull four months of unrelated drift into
this diff, which CONTRIBUTING explicitly warns against.