Commit graph

40160 commits

Author SHA1 Message Date
gavin
dbed3e4788
Merge branch 'develop' into socket_io-refactor 2022-11-17 15:21:20 +05:30
gavin
862a5a398d fix(socketio): Revert irrelevant & unused changes
Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
2022-11-17 15:20:00 +05:30
Faris Ansari
edf01ee1cd
fix(file): attached_to_name can be an integer (#18909)
* 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
2022-11-17 14:43:03 +05:30
Sagar Vora
f3c00c2bdc
perf: dont fetch meta unless required (#18907) 2022-11-17 13:15:35 +05:30
Ankush Menat
c658d8cb1b
fix: ignore unpicklable hooks (#18902)
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
2022-11-17 11:50:18 +05:30
Jannat Patel
6428930857
fix: security issue in discussions component (#18903)
[skip ci]
2022-11-17 11:39:43 +05:30
Ankush Menat
1f6f31fc97 refactor: int > cint 2022-11-17 11:35:24 +05:30
Athul Cyriac Ajay
190e01a5f3 fix: Force integer type in request.max_content_length 2022-11-17 11:35:24 +05:30
gavin
e32f0cd0f8
Merge branch 'develop' into socket_io-refactor 2022-11-16 23:08:23 +05:30
Gavin D'souza
c3c1848b2a fix: Restrict socket data to respective users after commit
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)
2022-11-16 23:07:07 +05:30
Gavin D'souza
16bd7a2d0b fix(socketio): Scoping & hoisting bugs
Due to the previous logic, cookie data seemed inconsistent causing ghost
sessions.
2022-11-16 23:02:23 +05:30
Gavin D'souza
96fee8c293 feat: {site}:website room open to all users
- 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
2022-11-16 21:53:49 +05:30
Ankush Menat
70633573c2
fix: dont convert row format if not required (#18900) 2022-11-16 20:48:50 +05:30
Shariq Ansari
2faa8ef292
Merge pull request #18894 from shariquerik/web-form-read-only 2022-11-16 17:56:55 +05:30
Shariq Ansari
990dcc7538
Merge branch 'develop' into web-form-read-only 2022-11-16 17:07:58 +05:30
Ankush Menat
0d5d2cf95c
ci: fix flake8 URL (#18895) 2022-11-16 16:15:31 +05:30
Shariq Ansari
424a7d39bc fix: webform read only field not working 2022-11-16 16:00:24 +05:30
Gavin D'souza
2b7e4554c4 fix(desk): maintain realtime & cached data consistency
- 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
2022-11-16 15:19:03 +05:30
Ankush Menat
45b0c3e28d chore: remove dead code 2022-11-16 14:05:53 +05:30
gavin
24f4b85031
Merge branch 'develop' into socket_io-refactor 2022-11-15 19:19:29 +05:30
Ankush Menat
9fc330ea6c
Revert "fix: remove middleware to clear frappe.local (#18874)" (#18886)
This reverts commit 2971abe517.
2022-11-15 18:45:51 +05:30
Gavin D'souza
3a8fa6cbd5 refactor(socketio): Use same room for doc & info events
other changes
- Name list room as doctype room for more generic use
- avoid re-setting up listeners for generic events
- discard docinfo_subscribe event
2022-11-15 17:55:53 +05:30
Ankush Menat
9b90e620bc chore: disable flaky test
This is
- flaky
- difficult to find source of flake because of crazy tests
- adds little value tbh

[skip ci]
2022-11-15 17:17:10 +05:30
Sagar Vora
425e4bf1b3
fix(File): validate attached_to_* when saving (#18880) 2022-11-15 16:19:02 +05:30
Gavin D'souza
97d2eab3e2 refactor(socketio): docinfo_update
- 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
2022-11-15 13:15:34 +05:30
Gavin D'souza
9931c3af04 refactor(socketio)!: list_update
- Subscribe to list_update only for the list/report views that are
  opened
- Check if user has read permission for doctype to subscribe to list
  updates
2022-11-15 13:15:34 +05:30
Gavin D'souza
e97994f211 chore: Drop duplicate event method
This particular definition was chosen since there was no corresponding
subscribe method with the same key generation logic
2022-11-15 13:15:34 +05:30
Gavin D'souza
54bf617d09 perf(socketio): get_site_name
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!
2022-11-15 13:15:34 +05:30
Gavin D'souza
4de9c39bb8 refactor: SocketIO
- 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
2022-11-15 13:15:30 +05:30
Gavin D'souza
5210ea593f fix(socketio): Re-try thrice before trying to reconnect
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.
2022-11-15 13:12:51 +05:30
Gavin D'souza
c86e1de38a fix(recorder): Publish update only to Administrator 2022-11-15 13:12:51 +05:30
Gavin D'souza
01fdb6a241 chore: Remove unused realtime updates
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.
2022-11-15 13:12:51 +05:30
Sagar Vora
2971abe517
fix: remove middleware to clear frappe.local (#18874) 2022-11-15 11:07:18 +05:30
gavin
440825a372
refactor: which > find_executable (#18872)
Use shutil from the standard library instead of distutils to find
executables in PATH
2022-11-14 18:15:38 +05:30
Faris Ansari
5695346668
fix: allow mark tag in texteditor (#18871) 2022-11-14 17:33:28 +05:30
Ankush Menat
990a96e48b
feat: show utilization percent on RQ Worker (#18868)
[skip ci]
2022-11-14 15:55:20 +05:30
Ritwik Puri
feb9190cac
fix: check if the doctype exists before adding default logtypes in log settings (#18867) 2022-11-14 15:54:41 +05:30
Ankush Menat
f019b4fab6
build(deps): update caniuse (#18866)
[skip ci]
2022-11-14 15:46:54 +05:30
Ritwik Puri
07f5075784
Merge pull request #18861 from resilient-tech/hardcode-doctype
fix: hardcode doctype in google oauth callback
2022-11-13 00:05:02 +05:30
Sagar Vora
838a52328c fix: hardcode doctype in google oauth callback 2022-11-12 23:51:15 +05:30
Ritwik Puri
0cd3d97132
Merge pull request #18856 from resilient-tech/better-templates
chore: fully commented, consistently formatted JS boilerplates
2022-11-12 20:41:23 +05:30
Ritwik Puri
518b7e1c66
Merge pull request #18251 from Aradhya-Tripathi/bg-submissions
feat: Background submissions for submittable doctypes
2022-11-12 20:06:57 +05:30
Aradhya
3759e5bbcd refactor: lint
fix: removed time.sleep
2022-11-12 20:06:17 +05:30
Aradhya
7c8af96046 refactor: leaving job status as it is on completion 2022-11-12 20:06:17 +05:30
Aradhya
1145bab9d8 refactor: checking docstatus before asserting failure 2022-11-12 20:06:17 +05:30
phot0n
b09eb2f317 fix: use index for ref_docname in submission queue doctype 2022-11-12 20:06:17 +05:30
phot0n
f9a10d32d1 fix: use quoted doctype and docname in alert 2022-11-12 20:06:17 +05:30
phot0n
ad6a11e34c feat: queue submission for bulk submit 2022-11-12 20:06:17 +05:30
phot0n
3dc376cd5c chore: remove reload listener from form 2022-11-12 15:16:05 +05:30
phot0n
b21f9a5b26 fix: submission queue banner
if last_failed_submission and last_submissions are equal, show only last_failed_submission
2022-11-12 15:10:46 +05:30