Commit graph

48668 commits

Author SHA1 Message Date
Akhil Narang
0612c011dc
chore: refactor for rq 2.x (#30935)
There's no `Connection` anymore - we need to explicitly pass it in everywhere

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-30 10:33:17 +05:30
Akhil Narang
22560c36f6
Merge pull request #28914 from samkit5495/patch-1
feat: add xss_sanitise to email fields
2025-01-29 17:45:52 +05:30
Akhil Narang
d7c3553714
chore: refactor for rq 2.x
There's no `Connection` anymore - we need to explicitly pass it in everywhere

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-29 17:38:23 +05:30
Akhil Narang
4717cc0bae
chore: move the logic into a separate function
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-29 17:22:45 +05:30
Ankush Menat
7a7b318662
build: bump gunicorn (#30928)
fast shutdown/restart fix: 4f74f4a4b8
2025-01-29 16:56:37 +05:30
Samkit Jain
dd48b54e3f
feat: add xss_sanitise to email fields 2025-01-29 16:48:54 +05:30
Akhil Narang
21ec09e4ef
fix(web_form): allow loading translations for more strings (#30931)
* Fix: Add more translation to web form

Fix that there is translation missing in frontend

* Fix missing translation context

* Adding left messages

* Fix typo

* Add even more missing translation

* chore: format

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: petnd <58605206+petnd@users.noreply.github.com>
2025-01-29 11:07:55 +00:00
Akhil Narang
17e3d12385
Merge pull request #30929 from akhilnarang/fix-sanitize-column
fix(sanitize_column): add newlines to the regex check
2025-01-29 16:22:43 +05:30
Akhil Narang
58268a6d8f
fix(sanitize_column): add newlines to the regex check
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-29 15:45:11 +05:30
Akhil Narang
60aa2f918a
Merge pull request #30896 from dhiashalabi/fix/reorder-setlang-initialization
fix: reorder session initialization in HTTPRequest to Fix Language Handling
2025-01-29 11:49:35 +05:30
Akhil Narang
d54f5e575a
Merge pull request #30910 from barredterra/timespan-days
feat: additional options for timespan filter
2025-01-29 11:27:20 +05:30
Akhil Narang
562f8212ec
Merge pull request #28955 from vishakhdesai/fix-idx-pagination
fix: update idx and name in table before rendering result rows
2025-01-29 11:22:22 +05:30
Akhil Narang
b94edc9d21
Merge pull request #30912 from cogk/patch-3
fix(blog): Fix typo in search query
2025-01-29 11:18:35 +05:30
Akhil Narang
7ee8b17ca8
chore: format
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-29 11:09:47 +05:30
Ankush Menat
2062a48ef8
fix: Respect no-cache header (#30921)
Browsers send this when user does ctrl+shift+r
2025-01-29 04:24:57 +00:00
Akhil Narang
4df2fbe615
Merge pull request #30913 from akhilnarang/fixup-30898
fix(attach): fix crash on web page builder
2025-01-28 22:01:20 +05:30
Akhil Narang
b0b0a4e36b
fix(attach): fix crash on web page builder
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-28 21:40:20 +05:30
Corentin Forler
cd68867535
fix(blog): Fix typo in search query 2025-01-28 17:03:14 +01:00
barredterra
aeb8ac1cb9 feat: additional options for timespan filter 2025-01-28 12:37:38 +01:00
Frappe PR Bot
443a81c8ab
fix: sync translations from crowdin (#29167) 2025-01-28 12:20:08 +01:00
Akhil Narang
9720ff2a8c
Merge pull request #30907 from akhilnarang/fixup-27805
fix(report_view): skip read_only condition checking for reportview
2025-01-28 10:35:59 +00:00
Ankush Menat
47fd3386fd
Revert "fix: Always reset globals on cached templates (#30897)" (#30906)
This reverts commit 32c1220c31.
2025-01-28 10:02:00 +00:00
Akhil Narang
531efc893f
Merge pull request #30899 from akhilnarang/fix-auto-repeat
fix(auto_repeat): take end date into consideration
2025-01-28 13:21:30 +05:30
Akhil Narang
41820d8f89
Merge pull request #30898 from akhilnarang/disable-attach-child-new-doc
fix: don't allow attaching a file to a child table in a new document
2025-01-28 13:13:55 +05:30
Akhil Narang
4b26b107a1
fix(auto_repeat): take end date into consideration
Otherwise we wouldn't add the end date in the schedule

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-28 13:10:48 +05:30
Akhil Narang
2fdc94840f
fix: don't allow attaching a file to a child table in a new document
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-28 12:37:18 +05:30
Ankush Menat
32c1220c31
fix: Always reset globals on cached templates (#30897) 2025-01-28 05:59:57 +00:00
Akhil Narang
baf884d31f
Merge pull request #29888 from akhilnarang/bench-browse-updates
feat: fixed session duration + better visibility of changes done via `bench browse`
2025-01-28 11:22:54 +05:30
DHia' A. SHalabi
8560764910 fix: reorder session initialization in HTTPRequest class 2025-01-27 18:49:13 +03:00
Raffael Meyer
4d041c1231
feat(Data Import): delete Data Import Log on trash (#30893) 2025-01-27 16:38:57 +01:00
Raffael Meyer
829a1404da
chore: bump actions/cache to v4 in boilerplate (#30889) 2025-01-27 12:01:09 +00:00
Akhil Narang
dcb58ab5c7
Merge pull request #30884 from akhilnarang/fixup-29172
fix: use strip_html() instead of escape_html()
2025-01-27 16:54:19 +05:30
Akhil Narang
4ef8629228
fix: use strip_html() instead of escape_html()
escape_html() removes `'`, which can be used in names

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-01-27 16:45:14 +05:30
Suraj Shetty
00914da9ce
Merge pull request #30045 from iamejaaz/child-table-lagging 2025-01-27 13:07:00 +05:30
Ankush Menat
078330485c
fix: Re-update jinja globals on cached templates (#30882) 2025-01-27 07:08:25 +00:00
Ejaaz Khan
b12e42f406 fix: add missing px in style 2025-01-27 11:56:49 +05:30
Ankush Menat
23694b6b3b
fix: Don't cache pages with query params (#30881)
This was always broken apparantly. Cache key only contains the path so
querystring is being ignored. If request has query params then we
shouldn't cache it.

WIP - better solution for caching based on cache headers. Anyway this
caching isn't THAT helpful since #29170
2025-01-27 06:22:43 +00:00
Ejaaz Khan
756670d675 refactor: optimize grid selection by reusing existing reference 2025-01-27 10:57:57 +05:30
Ejaaz Khan
e76cb990ab refactor: add scroll to current element, remove grid loop 2025-01-26 12:24:46 +05:30
Ankush Menat
9b79dfeb7b
perf: "random" naming to improve concurrency and locality (#30053)
This feels overengineered and it kinda is, but other efforts to
inroduce sequential naming/UUID naming haven't been that fruitful
either.

10 character random "hash" i now changed to.

1. first character - last character in UUID4 ID of request/job
2. three characters - derived from current timestamp.
4. 6 characters - random data.

This satisfies all three requirements:

1. Readers - temporal locality should result in spatial locality on disk. (fewer pages accessed)
2. Single writer - temporal locality should result in spatial locality. (fewer dirty pages)
3. Multiple writers - temporal locality should NOT result in spatial locality. (less lock contention)

Mostly concludes https://github.com/frappe/frappe/pull/25309 and https://github.com/frappe/frappe/pull/28349

Rough probabiliy numbers

Assumptions:
- Unique per worker prefix - 16 (uuid's base16 version)
- Rough time spent generating names - 10% of request (very very conservative estimate)

Probability(collision) = P(at least one prefix collision) * P(time collision)
Probability(collision) = (1 - p(all different)) * 10%
Probability(collision) = (1 - (16! / 16-N! )/ 16^N ) * 10%

| N (concurrency) | Probability(collision) |
| 1  |    0.0% |
| 2  |    0.6% |
| 3  |    1.8% |
| 4  |    3.3% |
| 5  |    5.0% |
| 6  |    6.6% |
| 7  |    7.9% |
| 8  |    8.8% |
2025-01-25 07:04:09 +00:00
Ankush Menat
473ff81a31 fix(UX): change cursor for clickable list count 2025-01-25 11:07:30 +05:30
Ankush Menat
a2d43aed66
Merge pull request #30050 from ankush/count_kill
perf: Hard-limit `get_count` runtime to 1 second
2025-01-25 10:32:26 +05:30
Ankush Menat
67fafdd812 perf: Set timeout in same query / avoid side effects 2025-01-25 10:22:08 +05:30
Ankush Menat
6ea200a48f fix: handle typical client tracking errors 2025-01-25 10:15:50 +05:30
Ankush Menat
658e6c5e73 perf: Hard-limit get_count runtime to 1 second
We have limited count to 1000 by default but this can still easily read
entire table if:
- There are filters and filters don't use index and there aren't 1000
  matching rows.

This unknown tail latency by default is not acceptable, so by default
any count query that fails to return results in 2 seconds will be
terminated and user will have to explicitly ask for the count.
2025-01-25 10:15:48 +05:30
Chris Francis
727a639ab1
Corrected Grammar in the CODE_OF_CONDUCT.md file (#29889) 2025-01-24 20:20:02 +01:00
Raffael Meyer
ba53d18642
Merge pull request #30051 from barredterra/mapper-perms-2 2025-01-24 20:05:48 +01:00
barredterra
015c9425ed Revert "fix: don't skip perm check when Apply Strict User Permissions is enabled (#29916)"
This reverts commit 4a0ccf6d76.
2025-01-24 19:56:44 +01:00
Raffael Meyer
10b429ffd6
Merge pull request #29132 from barredterra/fix-datetime-utils 2025-01-24 17:24:41 +01:00
Ankush Menat
d9081f170b
feat: HTTP caching on API endpoints (#29997)
* fix: update instead of extend

None of these are supposed to be extended over defaults.

* feat: custom response header support

* refactor: use response_headers to set cache control headers

* feat: Decorator to cache API response using cache-control headers

* perf: cache notifications for 1 minute

+ SWR for 5 minutes

* perf: cache `get_events` on desk load

* perf: slow down auto-refresh even more

once every 5 seconds instead of 2 seconds.

* perf: Cache plain link validation for 30 minutes

Very often you're picking same documents again and again, there's no
need to validate them.

Also, document is JUST selected using search_link, so it's 99%
guaranteed to be valid.

The real purpose of this function is to provide "fetch from" feature,
not link validation like the name suggests.

It will get validated server side anyway.

* fix: Never use HTTP cache in developer mode

* perf: cache "is_document_amended"

A document that is amended from something stays amended.

* perf: proxy-cache website_script.js

* fix: only cache if called directly
2025-01-24 20:04:57 +05:30