Skip to content
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

Checking for updates causes the app to crash #316

Closed
stasadev opened this issue Jun 3, 2022 · 3 comments · Fixed by #317
Closed

Checking for updates causes the app to crash #316

stasadev opened this issue Jun 3, 2022 · 3 comments · Fixed by #317
Assignees

Comments

@stasadev
Copy link

stasadev commented Jun 3, 2022

Describe the bug
It is impossible to use NoiseTorch without Internet (or if GitHub is down).

Version
v0.12.0

To Reproduce
Disconnect the Internet and show help for NoiseTorch from the terminal.

$ noisetorch -h
Couldn't fetch latest release Get "https://api.github.com/repos/noisetorch/NoiseTorch/releases?per_page=1&page=1": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x556be5779270]

goroutine 1 [running]:
main.getLatestRelease()
        noisetorch/update.go:181 +0x290
main.init()
        noisetorch/update.go:77 +0x2e

Expected behavior
NoiseTorch should not crash and continue to work as it did before the v0.12.0 release.

@AXDOOMER AXDOOMER self-assigned this Jun 3, 2022
@AXDOOMER
Copy link
Collaborator

AXDOOMER commented Jun 3, 2022

Good catch. I'll fix it.

@compico
Copy link

compico commented Jun 5, 2022

Similar problem. Github can return api rate limit for ip.

GET https://api.github.com/repos/noisetorch/NoiseTorch/releases?per_page=1&page=1

{
    "message" : "API rate limit exceeded for XXX.XXX.XXX.XXX. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
    "documentation_url" : "https://docs.github.com/rest/overview/resources-in-the-rest-api#rate-limiting"
}

Noisetorch Error:

Reading JSON for latest_release failed json: cannot unmarshal object into Go value of type main.github_releases
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.getLatestRelease()
	noisetorch/update.go:199 +0x477
main.init()
	noisetorch/update.go:77 +0x2e

@stasadev
Copy link
Author

stasadev commented Jun 5, 2022

@AXDOOMER Also, you may want to consider that checking for updates is only needed when starting the GUI, not when called from the terminal.

I mean, I agree with noisetorch -c, but there is no need to check for updates for every terminal call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants