-
Notifications
You must be signed in to change notification settings - Fork 13.1k
[Regression] Omnichannel visitors not able to upload files #19429
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
Conversation
shiqimei
left a comment
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.
Nice!
| const directMessageAllowed = settings.get('FileUpload_Enabled_Direct'); | ||
| const fileUploadAllowed = settings.get('FileUpload_Enabled'); | ||
| if (user?.type !== 'app' && canAccessRoom(room, user, file) !== true) { | ||
| if (user && user.type !== 'app' && canAccessRoom(room, user, file) !== true) { |
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.
@d-gubert I believe this bug was introduced in this commit 259af21#diff-2b708d47a45f905401f41f0b318f2462e95eebf42d8e049bc5474a6f65d2e779R69
| } | ||
|
|
||
| // allows inserts from omnichannel visitors | ||
| if (doc.visitorToken) { |
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.
you should not allow any document just because if has a visitorToken, it could lead to undesired results..
I think the permission validation was fixed by #19468
can you please test again removing this code and getting the latest changes from develop?
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.
Thanks @sampaiodiego It seems that the latest changes on develop branch have fixed all the above error which I was facing.
Its also worth mentioning that this change is also not required, since the of this validator which canAccessRoom calls returns true if the visitor belongs to the same room.
|
The errors I was facing in this PR, are fixed by #19468. Hence I'm closing this PR. Thanks everyone for all the help 😃 |
Proposed changes
Issue(s)
In the latest version of Rocket.Chat I found a bug due to which any omnichannel visitors were not able to upload files. When I tried uploading files from Livechat widget, I was getting this error.
and when I tried to upload via Apps-Engine latest upload interface, I was facing this error
How to test or reproduce
Via Livechat widget
http://localhost:3000/livechat) and send a message to start a session with livechat agentFileUpload error. It u check the console it should show that the api was unsuccessful)Via Apps-Engine
Set this visitorToken property within IUploadDescriptor
My Server Configuration
Rocket.Chat server Version | 3.8.0-develop
Apps Engine Version |1.19.0-alpha.4006
OS Platform | linux
Screenshots
Types of changes
Checklist
Changelog
Further comments