Restart menu when ussd session expires #201
Closed
opened 2024-12-04 16:49:22 +01:00 by lash
·
7 comments
No Branch/Tag Specified
master
phone-ussd
lash/stalecache
lash/purify-max
postgres-switch-for-tests
copy-language-code
lash/purify-more
account-pin-block-v2
lash/helpcomma
send-input-fix
lash/gettext
lash/dump-format
account-pin-block
lash/ssh-fixes
lash/ssh-4
log-session-id-at-sessionid
lash/purify
logs-at-sessionid
language-change-fix
hash-pin
menu-primary-selectors
lash/dump-key-prefix
force-restart-state
restart-state-devtool
mixed-languages
add-space-after-colon
link-terms-and-conditions
lash/store-dumper
back-state-check
double-session-id
profile-edit-traverse
data-items-cleanup
minor-bug-fixes
lash/persister-freakout
trigger-balance-reload
lash/no-persister-deadlock
voucher-details
single-error-node
sohail/trace-build-29-11
alias-address-validation
sohail/upgrade-deps
account-statement
sohail/docker-build
menu-balances
send-node
profile-edit-show
terminal-logs
readme-documentation
africastalking-endpoint
http-logs
log-file
swahili-templates-menu
api-error-fix
lash/export-to-term
pre-mock-remove
remove-db-mocks
pin-reset
tests-refactor
consolidate-temp-data-storage
profile-update-pin-check
voucher-data
lash/reverse-session
address-sessionId
menu-voucherlist
api-context
api-structs
send-menu-update
check-balance-update
postgres-switch
menu-api-errors
menu-traversal-v2
psql-switch
menu-traversal-refactor
menu-traversals
lash/subprefix
tests-update
menu-profile-edit
fix-repeated-nodes
wip-menu-select-fix
lash/ssh
go-vise-0.2.0
wip-main-refactor
at-return-output
wip-unit-tests
wip-pin-guard
change-language
wip-menu-help
wip-pin-reset
lash/vise-make-var
lash/async-driver
menu-options
unit-tests
wip-code-check
lash/draft-dev-0.1.0
wip-go-vise-dev-0.1.0
wip-flag-migration
v0.8.0-beta.11
v0.8.0-beta.10
v0.8.0-beta.9
v0.8.0-beta.8
v0.8.0-beta.7
v0.8.0-beta.6
v0.8.0-beta.5
v0.8.0-beta.4
v0.8.0-beta.3
v0.8.0-beta.2
v0.8.0-beta
v0.7.0-beta
v0.6.0-beta
v0.5.0-beta
v0.4.0-beta
v0.3.0-beta
v0.2.0-beta
v0.1.2-beta
v0.1.1-beta
v0.1.0-beta
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
cleanup
devops
documentation
easypeasy
exchange
i18n
legacy
meta
migration
optimization
privilege
refactor
smell
support
tooling
ux
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Activity
Doing
An item actively being worked on currently
Activity
Hold
Not being actively worked on
Activity
Proposal
A proposal for a new feature or enhancement
Activity
QA
Ready for QA testing
Activity
Validate
Dev team validating changes
Runner
AT
Runner
CLI
Runner
HTTP
Runner
SSH
A task that can be completed with little effort
relating to swapping of assets and offramps
Languages and translations
Legacy features from the old ussd system to be ported
container for other issues
features that have to do with special, privileged axx
Code smell
transparency and help with exception states
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: urdt/ussd#201
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User should be restarted from main menu when the AT session expires.
On new session, request id will change and input string will reset.
Most likely, the appropriate solution involves flushing the state bytecode in the
_firsthandler, and replace it withMOVE ^if simply an empty bytecode will not be sufficient.@lash I have tried resetting the state for the failed account sample (my number) but the engine kept bailing before running any of the handler code. This was a bit problematic trying to flush the state from the USSD code.
However, I noted that the cause of the engine bailing was the FLAG_TERMINATE flag, under vm>runner.go line 84
Resetting the flag before it returns enabled me to access the menu.
Can this be a solution outside the USSD (changing go-vise)?
@Alfred-mk is the
FLAG_TERMINATEset in your stored state?Yes it is set. Resetting it allows the menu to go back to the main node
@Alfred-mk so this is an abnormal sitation. Probably it came about because of an unclean exit, and for this kind of case we are going to need a manual tool to force restart from top as a last resort, i.e. #202
As for your account, the safe way to recover it would be to call
vise.state.State.Restart()(which would be the same the tool should do)Force restart of state on different request idto Restart menu when ussd session expirespersister retrieved from menustorageservice does not contain state (ref @Alfred-mk )
The persister retrieved from menustorageservice ...
... has a nil state and cache
One can only access the state once the engine is run
resolved by @Alfred-mk