africas-talking #50
Merged
lash
merged 8 commits from 2024-09-14 16:28:06 +02:00
africas-talking into lash/async-driver
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
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: urdt/ussd#50
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.
Adding Africa's Taking (AT) specific functionality
@@ -0,0 +232,4 @@rp := &atRequestParser{}bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)sh := httpserver.ToSessionHandler(bsh, httpserver.WithAtOutput())In general, chainable functions should be called ON the object instead of being an argument TO The object.
@@ -192,2 +194,3 @@//sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl.Init)sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)sh := httpserver.ToSessionHandler(bsh)In fact, I should have implemented this as chainable, too. My bad.
@@ -0,0 +1,123 @@package handlersIt would be better to have this PR against my async branch, because here we cannot see the differences....
I've updated the PR to reflect this
@@ -0,0 +90,4 @@return rqs, err}func (f *BaseSessionHandler) AtOutput(rqs RequestSession) (RequestSession, error) {This method should not exist in the base handler. Please EXTEND the handler to adapt it to your needs.
In fact, you probably need to extend the internal/http/server.go SessionHandler instead, since it in turn extends this, and also provides other functionality you need.
BaseSessionHandler -> http.SessionHandler -> at.SessionHandler
@@ -133,3 +127,1 @@if err != nil {f.writeError(w, 500, "Write result fail", err)returnif f.useAtOutput {Similary here, Please do not put AT speicifc code in the generic http code. Please use your own extension of the class.