-
Notifications
You must be signed in to change notification settings - Fork 23
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
rmapi: Update to 0.0.13 #5
base: master
Are you sure you want to change the base?
Conversation
This commit updates rmapi to 0.0.13. This gives a few benefits (like having authentication errors) but most usefully includes additional support for XDG_CONFIG_DIR for storing tokens rather than requiring them to be stored in $HOME.
@@ -32,10 +32,11 @@ func New() (Remarkable, error) { | |||
log.InitLog() | |||
|
|||
for i := 0; i < rmAuthRetries; i++ { | |||
rm = api.CreateApiCtx(api.AuthHttpCtx()) | |||
var err error | |||
rm, err = api.CreateApiCtx(api.AuthHttpCtx(false, false)) |
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.
The AuthHttpCtx here added two arguments:
- the first being
reAuth
which forces a reauth regardless of an existing token. I've gone for false here because that seems unnecessary? - the second being
nonInteractive
which would result in failure if there isn't a valid authentication token already. It might be useful to include a flag for running on servers here but I've avoided doing it for now.
@@ -99,7 +100,7 @@ func (r Remarkable) SyncFileAndRename(file, title string) error { | |||
r.api.Filetree.AddDocument(*document) | |||
|
|||
// Move the file to the title. | |||
docName := util.DocPathToName(filepath.Base(file)) | |||
docName, _ := util.DocPathToName(filepath.Base(file)) |
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.
The extra value is the file extension - which we don't need here.
This fixes #6 right? I tried using this PR but ended up with SIGSEV:
|
@david-caro huh interesting - I haven't rebuilt this since I opened the PR, but it was working at the time. I'll take a look at fixing it tomorrow. Looks like some case returns err == nil and rm == nil potentially. |
It seems I'm getting unauthorized error, it only shows when debug is enabled:
|
I bumped rmapi to 0.0.15 and it worked now :) |
This commit updates rmapi to 0.0.13.
This gives a few benefits (like having authentication errors) but most usefully includes additional support for
$XDG_CONFIG_DIR
for storing tokens rather than requiring them to be stored in$HOME
.