-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile companion app #2715
base: master
Are you sure you want to change the base?
Mobile companion app #2715
Conversation
59e518c
to
278b70c
Compare
2fc37fe
to
74870f8
Compare
d725dd6
to
c3df1bc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to build the app without problems. Could you rebase? I think there's a problem with the commit it is built off of preventing me from building the client.
|
||
if cfg.Logger != nil { | ||
log = cfg.Logger | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If log is nil we should error or we will get a panic later. Will we be calling New more than once? In that case maybe we shouldn't use a shared log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New
is called repeatedly in webserver_test.go
, this change fixes a race:
bf0a925****
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not actually sure this is the most elegant solution btw, suggestions appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just make a new logger for every test? Is the problem using the same logger for multiple tests at the same time? I thought the logger could handle concurrent logs though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the problem now, we change the logger as it is being used.
imo the correct way to solve this is to make log
part of the WebServer struct
and remove the package level one. It can't be used before being initiated with New
anyhow, so there's no reason for it to be package level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was thinking if we can kill two birds with one stone and have the mobile companion as a flutter application. That way we can benefit both android and ios users.
@buck54321, @JoeGruffins, @peterzen what do you think?
@@ -244,6 +244,38 @@ func (s *WebServer) handleGenerateQRCode(w http.ResponseWriter, r *http.Request) | |||
} | |||
} | |||
|
|||
// handleGenerateQRCode is the handler for the '/generateqrcode' page request | |||
func (s *WebServer) handleGenerateCompanionAppQRCode(w http.ResponseWriter, r *http.Request) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this space
func (s *WebServer) handleGenerateCompanionAppQRCode(w http.ResponseWriter, r *http.Request) { | ||
|
||
var url string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remove this space
// Create auth token and append it to the URL for authTokenMiddleware to pick up. | ||
// TODO save this token in the DB to make it permanent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this token changed at any point in time?
cm.Wait() | ||
wg.Done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to block until s.ctx cancellation here.
} | ||
|
||
android { | ||
namespace 'org.decred.dex.dexandroid' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just org.decred.dex
should be okay, no?
compileSdk 34 | ||
|
||
defaultConfig { | ||
applicationId "org.decred.dex.dexandroid" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just org.decred.dex
should be okay, no?
This adds a tor hidden service, and a settings dialog that generates the QR code of the .onion URL for pairing with a mobile app.
The Android app code is under
/companionapp/android
. This can be loaded into Android Studio for building and running in the AVD emulator.Pairing dialog