Executables not accessing the same state #23
Closed
opened 2025-02-19 11:37:53 +01:00 by Alfred-mk
·
3 comments
No Branch/Tag Specified
master
send-max-amount-hotfix
shorten-menus
allow-stables-direct-to-mpesa
debt-menu
credit-send-pool-selection-hotfix
have-single-send-node
self-pin-reset
cache-error-fix
mpesa-onramp-offramp
update-balance-on-empty-vouchers
cached_symbols_hotfix
update-go-vise
credit-send-hotfix
send-with-swap
pool-debug
handle-error-codes
normalize-symbols-on-api
ui-cleanup-update
sync-flags
exclude-active-data-from-lists
move-pools-menu
project-tidyup
new-alias-flow
add-balance-to-voucher-list
update-alias
fix-amount-conversion
cosmetic-fixes
hotfix/v1.2.5-rc.1
add-pool-selection
swap-fix
hotfix/v1.2.5-rc
default-env-pool
alfred/pool-swap
sohail/experimental
vouchers-input-selection
checksum-address
alias-register-enhancement
route-api-errors
logdb
extra-sms
update-recipient-validator
update-userdata-devtool
self-pin-reset-node
sms-upsell
lash/attack-of-the-clones
manage-vouchers-in-single-function
address-sms
help-menu
fix-double-alias-request
lash/reset
fix-multiple-alias-requests
active-sym-debug
test-coverage-bump
ens
fix-pin-reset-bug
remove-session-id-from-ctx
tests-menu-traversal
alfred/test-updates
debug-errors-with-temporary-value
clear-temporary-valua-after-use
lash/custom-engin
lash/async-inputs
reset-execpath
menu-invalid-inputs
minor-bug-fixes
update-dependency
alias-fqdn
fix-remote-new-args
lash/dbtx
reset-account-blocked-flag
data-migration
encrypt-pin
lash/update-dump
lash/admin-tool
contact-info-on-pending-page
lash/fix-ssh
lash/api-select
lash/initial-language
lash/dev-api-buildtag
lash/events
v1.4.7-rc.6
v1.4.7-rc.5
v1.4.7-rc.4
v1.4.7-rc.3
v1.4.7-rc.2
v1.4.7-rc.1
v1.4.7-rc
v1.4.6-rc.12
v1.4.6-rc.11
v1.4.6-rc.9
v1.4.6-rc.8
v1.4.6-rc.7
v1.4.6-rc.6
v1.4.6-rc.5
v1.4.6-rc.4
v1.4.6-rc.3
v1.4.6-rc.2
v1.4.6-rc.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.0-beta.1
v0.15.0-beta.1
v0.14.0-beta.1
v0.13.0-beta.1
v0.12.0-beta.1
v0.11.0-beta.1
v0.10.0-beta.1
v0.9.0-beta.1
Labels
Clear labels
ussd/user-reported
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Issue reported by a user while interacting with the ussd
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
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: grassrootseconomics/sarafu-vise#23
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?
When running executables using the same session-id and connection string, it is expected that one would get the same state
Running the menu using cmd/main.go for session-id +254712345678 should result in the same menu gotten from cmd/africastalking/main.go
This is crucial as other executables rely on this principle, such as devtools/admin/main.go
Case examples
These two executables will default to the defined DB_CONN and DB_CONN_RESOURCE strings in the .env
However, completing registration in the
sarafu-atwith thephoneNumberas+254712345678will not allow you to proceed with the menu from thesarafu-cmd. Instead, one has to restart the registration*After registration, both executables retain their own unique states, even after restart
What the
sarafu-atandsarafu-asynccreate (correct state)What
sarafu-cmdcreatesThe
sarafu-cmdsaves under<sessionId>.<sessionId>whilesarafu-atandsarafu-asyncsave under<sessionId>The
devtools/admin/main.goreads from the<sessionId>.<sessionId>resulting in an error when accessing account data created bysarafu-atea6bfa050e/db/db.go (L171)For
sarafu-atorsarafu-async, the sessionId is not set in the context (ctx). once the SetSession is called, the baseDb.sid is set to an empty byte, leading to a final sessionKey of just<sessionId>When the same
SetSessionis called onsarafu-cmdor theadmin devtool, the sessionId exists in the context.This sets the baseDb.sid to
<sessionId>., leading to a final sessionKey of<sessionId>.<sessionId>Removing the sessionId from the ctx in the
devtool/admin/main.goandcmd/main.goresolves the issueResolved by PR #25