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

Fyne error: Preferences load error #2936

Closed
alihongbo opened this issue Apr 21, 2022 · 9 comments
Closed

Fyne error: Preferences load error #2936

alihongbo opened this issue Apr 21, 2022 · 9 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@alihongbo
Copy link

alihongbo commented Apr 21, 2022

Describe the bug:

2022/04/21 20:15:04 Fyne error: Preferences load error:
2022/04/21 20:15:04 Cause: EOF
2022/04/21 20:15:04 At: ./vendor/fyne.io/fyne/v2/app/preferences.go:84

To Reproduce:

Steps to reproduce the behaviour:

Preferences is used in the project. At first, it is good. After running for a period of time, an error will be prompted. Even if the code of preferences is deleted from the project, the operation will still report an error.

Screenshots:

image

Example code:

xxx.Preferences().String("xxx")
xxx.Preferences().SetString("xxx","ccc")
xxx.Preferences().RemoveValue("xxx")

Device (please complete the following information):

  • OS: MacOS
  • Version: 11.6.2
  • Go version: 1.18
  • Fyne version: 2.1.4
@alihongbo alihongbo added the unverified A bug that has been reported but not verified label Apr 21, 2022
@Jacalz
Copy link
Member

Jacalz commented Apr 21, 2022

Would you mind including the entire example code? Also, can you please try with the latest v2.1.x release (v2.1.4 at the time of writing)?

@alihongbo
Copy link
Author

Trace the source code and find the ~/library/preferences/xxx/fyne directory. Delete the Fyne folder and no error will be reported. It is suspected that an exception occurred during the process of writing the configuration.

@alihongbo
Copy link
Author

Would you mind including the entire example code? Also, can you please try with the latest v2.1.x release (v2.1.4 at the time of writing)?

yes v2.1.4

@Jacalz
Copy link
Member

Jacalz commented Apr 21, 2022

Trace the source code and find the ~/library/preferences/xxx/fyne directory. Delete the Fyne folder and no error will be reported. It is suspected that an exception occurred during the process of writing the configuration.

Sorry, I don’t understand what you mean with “tracing the source code”. Can you please add your example code (see information in the template) to the issue description?

@andydotxyz
Copy link
Member

It does look like the code is generating some sort of invalid JSON somehow.
It would be really helpful to see the contents of the preference file that you have tracked down when this error occurs @HongBook

@alihongbo
Copy link
Author

It does look like the code is generating some sort of invalid JSON somehow. It would be really helpful to see the contents of the preference file that you have tracked down when this error occurs @HongBook

the preference file is empty.

@alihongbo
Copy link
Author

Trace the source code and find the ~/library/preferences/xxx/fyne directory. Delete the Fyne folder and no error will be reported. It is suspected that an exception occurred during the process of writing the configuration.

Sorry, I don’t understand what you mean with “tracing the source code”. Can you please add your example code (see information in the template) to the issue description?

I mean "debug".

@andydotxyz
Copy link
Member

OK thanks. So somehow we are writing an empty file? This is super strange.
Does your app seem to lose data, or does the file write successfully when you exit the app?

@andydotxyz
Copy link
Member

I think that @Bluebugs may have tracked this down and documented stack trace in #3015 - closing as duplicate of that which is going to be easier to track the fix.

@andydotxyz andydotxyz added bug Something isn't working duplicate This issue or pull request already exists and removed unverified A bug that has been reported but not verified labels May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants