-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix image upload settings #135
Conversation
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.
Using your frontend branch fix-settings-update,I have two issues, I would like you to reproduce.
- Uploading an image with a long weird name like
Screenshot from 2023-12-01 10-29-03.png
leads to the error "GET http://localhost:3000/[object%20File] HTTP/1.1" - Updating to the main item works fine with newspaper and calendar but item "Digitale Zeitung" leads to the error state that no database values are shown in the backoffice. I think this a frontend error of a hardcoded value, which I thought you solved @nanu-c but maybe not in the settingsupdate frontend page?
Hi @lebe1, both errors do not appear in my local setup. |
After a more extended testing I found more details on these issues. 1. Error of uploading images 2. Error of changing main items several items |
Hi @lebe1 I've been trying to change images and item back and forth and still cannot reproduce the error :/ |
Hi @jofmi and @nanu-c, Screencast_Firefox_DB_not_connected.webmScreencast_Firefox_file_path.webmHere are both errors shown on Chrome: Screencast_Chrome_DB_not_connected.webmScreencast_Chrome_file_path.webm |
This part is now solved here -> augustin-wien/augustina-frontend#92 |
And also i can't reproduce the main item change all breaks error either here. |
log.Info("No file passed or file is invalid", err) | ||
// Do not return error, as not passing a file is ok | ||
// Could be improved by differentiating between not passed and invalid file | ||
err = nil |
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.
maybe close the file, too here.
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.
this is not possible if there's an error, the file object cannot be closed since it has not been opened
@lebe1 i have tried reproducing again with your video, with no success. i also tried to create a new item like it was already available in your video, which also created no issues. Can you see if the error still appears on your end if you use Aarons new branch augustin-wien/augustina-frontend#92? I also upgraded pgx to the latest version to see if this can fix your issue. Best i can suggest otherwise is that I take a look at the issue on your laptop directly. |
I have the thought that this might be caused by the frontend sending two overlapping db requests - since it happened when the frontend had the loop issue of sending GET and PATCH requests to the backend over and over again. Maybe connected: jackc/pgx#635, esp. jackc/pgx#635 (comment) @nanu-c, might there be a fundamental mistake how we do queries? We could add some healthcheck config to pgxpool.New in db.go:120 https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#ParseConfig Could also help: https://github.com/uber-go/goleak |
I have added another improvement that closes all rows after a db query and added additional error logs. |
Just tested changing the Mainitem with the new frontend branch and I still ran into the same db-connection-loss error. I could also reproduce the same db-connection-loss error by uploading a .jpg file instead of a suggested .png file. Besides this uploading a new logo, which is a .png file works like a charme. Hopefully, this is just a local issue on my machine and changing the main item is really not a common use case but maybe we stick all our heads together this friday to decide how to go further with this? |
Still no errors in the logs with the latest version of this branch? |
deleted |
Sadly no errors given besides the info |
Type of change
Description
Fixed WriteJSON payload for updateSettings.
The wrong payload to WriteJSON broke the container without throwing an error - this issue is still not solved as I do not know the cause.
Checklist: