Commit graph

48222 commits

Author SHA1 Message Date
Hussain Nagaria
2f8c7c7b0d chore: remove dead code 2024-12-18 12:47:19 +05:30
Ankush Menat
23b5b0c7ae
perf: speedup QB field sanitization (#28818) 2024-12-18 05:47:02 +00:00
Sumit Bhanushali
051cedb860
chore: update readme (#28819) 2024-12-17 18:35:10 +00:00
Ankush Menat
ea49c2500c
perf: speedup @redis_cache (#28813)
* perf: reduce one redis call for redis_cache

* fix: Always set value in local even if it expires
2024-12-17 18:49:07 +05:30
Ankush Menat
3297aff294 fix: Always set value in local even if it expires 2024-12-17 18:34:45 +05:30
Ankush Menat
b5218096e1 perf: reduce one redis call for redis_cache 2024-12-17 18:04:43 +05:30
Ankush Menat
30ec033747
perf: Speedup get_doc by another ~1.5x (#28807)
* perf: Reduce impact of forced cache replacement on every doc access

* fix: clear cache before processing users

Note: This is just an artifact of testing model, this won't have any real
effect on execution in real system.

Basically `enqueue_on_commit` is not respected in tests and it can't be
practically supported either.
2024-12-17 16:48:43 +05:30
Akhil Narang
b861a014ac
Merge pull request #28804 from RitvikSardana/csv-support
fix: add support for CSV files for non desk users
2024-12-17 16:47:16 +05:30
Akhil Narang
1dcf04a681
Merge pull request #28810 from akhilnarang/email-receive-imaplib-flags-string
fix(email): don't try to parse flags that seem to be invalid
2024-12-17 16:21:15 +05:30
Akhil Narang
d285dd5cbf
fix(email): don't try to parse flags that seem to be invalid
Sometimes we get invalid flags from `imap.uid()`, like `[b'System Error (Failure)']`

This leads to the flag getting parsed as 83 (`ord('S')`)

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-17 16:04:05 +05:30
Ankush Menat
d0c314090c
perf: speed up recurring redis cache accesses (#28805) 2024-12-17 14:06:01 +05:30
RitvikSardana
6e524ada8f chore: code cleanup 2024-12-17 13:11:57 +05:30
RitvikSardana
f6637d7ef0 fix: change error message 2024-12-17 13:10:27 +05:30
RitvikSardana
15f64fa7bc fix: add support for CSV files for non desk users 2024-12-17 13:06:21 +05:30
Ankush Menat
c1c4a7dd48
perf: speed up @request_cache by ~2x (#28803)
- Eagerly initialize request_cache, all requests use it, so what is the
  point of doing it lazily?
- Reduce accesses to `frappe.local` namespace, get cache once and reuse
  it in rest of the execution.

Before: 1250ns +/- 1%
After: 645ns +/- 1%

Source: Trust me bro.
(no really, for now just trust me or look at the diff)
2024-12-17 07:35:38 +00:00
Ankush Menat
98a33b4516
perf!: speedup @site_cache by ~4x (#28802)
* perf(site_cache): reduce access to frappe.local namespace

This change also allows calling @site_cache during init, as long as `site` parameter is set.

* test: frappe.init patching

* perf: use monotonic time instead of realtime for eviction

datetime is complex, slow and not really required for this use case.

* perf!: Drop support for unhashable arguments

Just like LRU cache, no need to support unhashable types in site_cache.
Current usage in codebase also shows that it's not required and json.dumps is quite slow.
2024-12-17 12:24:09 +05:30
Ankush Menat
9951f151f5 perf!: Drop support for unhashable arguments
Just like LRU cache, no need to support unhashable types in site_cache.
Current usage in codebase also shows that it's not required and json.dumps is quite slow.
2024-12-17 11:48:17 +05:30
Ankush Menat
f9ed28956d perf: use monotonic time instead of realtime for eviction
datetime is complex, slow and not really required for this use case.
2024-12-17 11:41:55 +05:30
Ankush Menat
ad0e8ed735 test: frappe.init patching 2024-12-17 11:33:21 +05:30
Ankush Menat
3675f3c797 perf(site_cache): reduce access to frappe.local namespace
This change also allows calling @site_cache during init, as long as `site` parameter is set.
2024-12-17 11:23:51 +05:30
Ankush Menat
531b9a3e3d
Merge pull request #28799 from ankush/perf/patching_bug
perf: Avoid patching QB in every request
2024-12-17 11:20:42 +05:30
Ankush Menat
5bf50b6bc2 perf: Avoid patching QB in every request 2024-12-17 10:58:31 +05:30
Ankush Menat
6ad70cb604
Merge pull request #28791 from ankush/update_mariadb
chore: update tested mariadb versions
2024-12-16 19:03:46 +05:30
Ankush Menat
54af230131 chore: update tested mariadb versions 2024-12-16 19:02:38 +05:30
Ankush Menat
5e4f23720a
perf: Use raw SQL for fetching documents (#28789)
`get_doc` is single most used commands, directly and indirectly.
Currently there's QB overhead of building queries.

These queries are SO SIMPLE, I don't believe we need QB to keep these
maintainable or compatible with databases.

Microbenchmarks (first is simple flat document, second has many child tables):

```
bench_orm_bench_get_doc: Mean +- std dev: [before] 10.7 ms +- 0.2 ms -> [after] 7.24 ms +- 0.15 ms: 1.48x faster
bench_orm_bench_get_user: Mean +- std dev: [before] 16.3 ms +- 0.2 ms -> [after] 9.50 ms +- 0.14 ms: 1.72x faster
```
2024-12-16 13:27:07 +00:00
Akhil Narang
2bbf78aa73
Merge pull request #28783 from akhilnarang/package-within-site
fix(package): validate package name, export path
2024-12-16 17:44:05 +05:30
Akhil Narang
fae07e4bbb
fix(package): validate package name, export path
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-16 17:19:54 +05:30
Akhil Narang
dc85db263b
Merge pull request #28782 from akhilnarang/use-actions-directly
refactor(ci): don't fetch actions from develop
2024-12-16 16:25:23 +05:30
Akhil Narang
c0d0a137ec
fix(ci): drop ubuntu version check for wkhtmltopdf
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-16 16:10:56 +05:30
Akhil Narang
fadbddff2e
refactor(ci): don't fetch actions from develop
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-16 16:10:46 +05:30
Ankush Menat
d6adc3d7c2
fix: Don't cache anything hashable (#28780)
* fix: Don't cache anything hashable

If filters are list or dict then they aren't hashable, there was little
reason to do this IMO.

If something is indeed cacheable then where is the eviction for it?
simple k:v is only thing we can realistically cache here.

* ci: Dont specify client version

Clients work on mysql protocol ABI which works for huge ranges of
servers.
2024-12-16 13:36:14 +05:30
Ankush Menat
f5b22ee2f4 ci: Dont specify client version
Clients work on mysql protocol ABI which works for huge ranges of
servers.
2024-12-16 13:22:30 +05:30
Ankush Menat
eaa6e4003a fix: Don't cache anything hashable
If filters are list or dict then they aren't hashable, there was little
reason to do this IMO.

If something is indeed cacheable then where is the eviction for it?
simple k:v is only thing we can realistically cache here.
2024-12-16 13:17:09 +05:30
Akhil Narang
8b7222eac6
Merge pull request #28773 from frappe/dependabot/npm_and_yarn/nanoid-3.3.8
chore(deps): bump nanoid from 3.3.7 to 3.3.8
2024-12-16 12:02:36 +05:30
Akhil Narang
d2990caa48
Merge pull request #28777 from iamejaaz/static-width-childtable
fix: pre defined columns width issue in childtable
2024-12-16 10:50:41 +05:30
Akhil Narang
9f91829fb0
Merge pull request #28776 from iamejaaz/safari-overlow-issue-childtable
fix: link field issue with scrollable child table in safari
2024-12-16 10:50:22 +05:30
Ejaaz Khan
4a477b9be4 fix: pre defined columns width issue 2024-12-15 21:10:59 +05:30
Ejaaz Khan
4aa02f8004 fix: link field issue with scrollable child table 2024-12-15 20:28:50 +05:30
dependabot[bot]
240da6fb24
chore(deps): bump nanoid from 3.3.7 to 3.3.8
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-14 09:38:29 +00:00
Akhil Narang
9fd891d01e
Merge pull request #28769 from akhilnarang/fix-unbound-local-widgets
fix(save_new_widget): prevent `UnboundLocalError`
2024-12-13 15:14:24 +05:30
Akhil Narang
ccde8a1922
fix(save_new_widget): prevent UnboundLocalError
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-13 14:59:09 +05:30
Akhil Narang
058702bd3c
Merge pull request #28765 from akhilnarang/jinja-boot-json
fix: convert frappe.boot to JSON properly
2024-12-13 12:23:28 +05:30
Akhil Narang
4509e75179
fix: convert frappe.boot to JSON properly
We have `frappe.as_json` set as the jinja filter for json

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-13 11:45:57 +05:30
Corentin Forler
50020cffda
fix(web): Ensure that header values are strings (#28760) 2024-12-12 19:32:12 +05:30
Akhil Narang
0c8e49b72b
Merge pull request #28759 from blaggacao/fix/test-breakpoint-honoring
fix(testing): clarify --pdb to --debug from a users perspective and also attach pdb on any exception
2024-12-12 18:04:32 +05:30
David
1d31663f4b
fix(testing): clarify --pdb to --debug from a users perspective; also attach pdb on any exception
prior, the implementation attached to AssertionErrors
and the flag did not represent that this disables the buffer so that normal breakpoints work
2024-12-12 13:19:20 +01:00
Ankush Menat
82264e7986
fix: keep a large enough limit on group-by query (#28754)
Small change on top of https://github.com/frappe/frappe/pull/28740

Reason: Site with many many users might still have huge # of rows being
returned. E.g. FC.

This just makes UX slightly bad, but there's easy workaround for it.
Users can just apply this filter -> "Owner = Self", whether users know
it or not is a different question.
2024-12-12 05:11:46 +00:00
Raffael Meyer
7c06c845ea
Merge pull request #28674 from frappe/l10n_develop
fix: sync translations from crowdin
2024-12-12 02:39:35 +01:00
barredterra
b2ec589390 test: make test translation independent from real ones 2024-12-12 00:57:14 +01:00
barredterra
8acd5568c4 Merge remote-tracking branch 'upstream/develop' into l10n_develop 2024-12-12 00:50:46 +01:00