* fix(file): attached_to_name can be an integer
incorrect validation introduces via
https://github.com/frappe/frappe/pull/18880
* test(file): set correct fieldname
* fix: check for str, int explicitly
If any custom app use import statement in hooks.py everything breaks.
Hooks.py while being python file is still only supposed to be used for
configuring.
This PR ignores unpicklable members of hooks.py
Fix conditions to bother only those who asked for the data:
- Clear permissions cache only for updated users' data
- Defer appropriate events until commit to avoid ghost events
- Remove event unused by desk (and other apps)
- Subscribe to room and pass messages without auth
- Pass `room='website'` to publish_realtime to use
- Pass discussions' comms through particular site's website room
- Clear docinfo_update callbacks before setting one; ensure only
one active callback at any given point.
- Remove document from local cache if list_update sent if not edited
other changes
- Name list room as doctype room for more generic use
- avoid re-setting up listeners for generic events
- discard docinfo_subscribe event
- Rename event from `update_docinfo_for_{}_{}` to docinfo_update
- Separate rooms for separate documents generated on requirement
- Check if user has access to doc before sharing docinfo
The usages and number of conditions evaluated in the function called for
some sort of a cache. If the site name is evaluated once, store it in
the socket object!
- Check request data in middleware
- Authenticate each connection before allowing room access
- Allow site room access only to System Users, restrict Website User &
Guests to their respective user rooms
Note: This doesn't check for roles / permissions
Set reconnectionAttempts to 3. If the server doesn't want to connect
with the respective client (invalid origin, no cookie or sid transmitted)
or is gone down, socketio client would retry connections indefinitely.
This change limits retrying connection to just thrice every second.
These events were added for supporting listeners in desk. The listeners
have thus been removed and these are now unnecessary messages published
to anyone landing on Frappe pages or on Desk.