Commit graph

54583 commits

Author SHA1 Message Date
Saqib Ansari
53e7e34948 refactor: make token initialization simple 2026-04-22 16:20:54 +05:30
Saqib Ansari
850cc58664 fix: clear_cache for shared cache 2026-04-22 16:20:54 +05:30
Saqib Ansari
757f283eea feat: add get_stats function to retrieve concurrency limits 2026-04-22 16:20:54 +05:30
Saqib Ansari
0064eb80b4 fix: support shared RedisSemaphores for concurrency limits 2026-04-22 16:20:54 +05:30
Saqib Ansari
7f78cd25f9 refactor: extract RedisSemaphore into redis_semaphore.py 2026-04-22 16:20:54 +05:30
Saqib Ansari
65965b9c44 fix: use site_cache as clear_cache is broken for redis_cache 2026-04-22 16:20:54 +05:30
Saqib Ansari
d618a88f01 feat: derive concurrency limit from gunicorn master's cmdline
Co-authored-by: Copilot <copilot@github.com>
2026-04-18 15:37:14 +05:30
Saqib Ansari
4eafb38f98 test: rewrite concurrent_limit tests to test through public interface 2026-04-18 14:58:47 +05:30
Saqib Ansari
033d49b488 fix: add TTL to capacity key so pool self-heals after worker crash
If a gunicorn worker is killed (SIGKILL, OOM) while holding a token, the
token is never returned to the pool. With no TTL on the capacity key,
`setnx` would never fire again, so the pool shrinks permanently — with
`limit=3` you silently end up at `limit=2`, then `limit=1`, etc.

Set a 1-hour TTL (`_CAPACITY_KEY_TTL`) on the capacity key via the
`NX EX` form of SET in the Lua init script. When the key expires the next
request re-initializes the pool to full capacity, so the semaphore is
self-healing without manual Redis key deletion.
2026-04-18 14:26:17 +05:30
Saqib Ansari
8589f26ce9 fix: atomically initialize token pool via Lua script in _ensure_tokens
Replace the `setnx` + pipeline pair with a Lua script evaluated in a
single round-trip. The prior approach had a race window: between the
`SET NX` succeeding and the `MULTI/EXEC` pipeline running, a concurrent
worker could BLPOP from the list just before `DEL` wiped it — losing
tokens permanently. A process crash in that window left the capacity flag
set but the token list empty, breaking the semaphore with no recovery path.

The Lua script makes the check-and-initialize atomic: Redis executes it as
a single unit with no interleaving, so the race window is closed.
2026-04-18 14:25:30 +05:30
Saqib Ansari
e8c7eb946b refactor: rewrite concurrent_limit to use LIST + BLPOP semaphore
Replace the INCRBY-based polling loop with a proper token pool backed by
a Redis LIST. BLPOP blocks until a token is available instead of sleeping
and retrying, which is more efficient and avoids the check-then-act race
of the old counter approach.

Other fixes bundled in:
- Add `blpop` and `setnx` wrappers to `RedisWrapper` so all key prefixing
  goes through `make_key` consistently
- Cache `_default_limit()` result with `@redis_cache(shared=True)` to
  avoid importing `multiprocessing` on every request
- Fix `limit=0` edge case: use `is not None` guard instead of falsy check
- Guard `_release()` against pushing the `"fallback"` token back into the
  pool when Redis was unavailable during acquire
2026-04-18 14:21:33 +05:30
Saqib Ansari
18d73d8045 fix: tests 2026-04-14 11:07:48 +05:30
Saqib Ansari
76eb3297cd refactor: set Retry-After header directly 2026-04-10 22:43:45 +05:30
Saqib Ansari
2f30dac5d8 feat: implement concurrency limiting decorator 2026-04-10 22:22:23 +05:30
Nabin Hait
115d3cead0
feat(assignment_rule): add weighted distribution strategy (#37741) 2026-03-05 14:31:03 +05:30
Soham Kulkarni
b6ee391bd2
Merge pull request #37791 from sokumon/user-avatar 2026-03-05 13:47:56 +05:30
Ejaaz Khan
3f6ee6388d
Merge pull request #37792 from frappe/revert-37584-fix-grid-row-flex-alignment
Revert "fix: prevent red validation border from disappearing in editable grid rows"
2026-03-05 12:42:14 +05:30
Adhithi M R
0409235563
fix: preserve original role permissions during role replication (#35356)
* chore: format code with ruff formatter

* fix: fetch all custom docperms when replicating role

* fix: avoid setup custom perms call for seen doctypes

* fix(test): ensure custom perms are not setup for any role

* chore: remove steps to replicate since url already mentioned

---------

Co-authored-by: Adhithimr <adhitimr@gmail.com>
Co-authored-by: Gursheen Anand <gursheen@frappe.io>
2026-03-05 12:39:18 +05:30
Nishka Gosalia
29e52f6deb
fix: percent precision when value is undefined (#37755)
Co-authored-by: Nishka Gosalia <nishkagosalia@Nishkas-MacBook-Air.local>
2026-03-05 12:27:06 +05:30
Ejaaz Khan
41798c2182
Revert "fix: prevent red validation border from disappearing in editable grid rows" 2026-03-05 11:49:21 +05:30
sokumon
fa822b31d4 fix: customize sidebar header via standard navbar_items hook 2026-03-05 11:34:17 +05:30
MochaMind
786059047b
fix: Hungarian translations (#37785) 2026-03-05 05:35:53 +00:00
Shllokkk
d3fef95937
feat: add on_render_node hook to tree.js (#37779) 2026-03-05 11:04:52 +05:30
Kerolles Fathy
859dc66ef1
fix(gantt): make bottom time span bar move with page scroll (#36985) 2026-03-05 11:03:31 +05:30
Akhil Narang
743926c02f
fix: escape user image (#37764) 2026-03-05 10:59:23 +05:30
sokumon
7933a201dd fix: move logout from user avatar to sidebar dropdown 2026-03-05 10:58:57 +05:30
dependabot[bot]
d8ca02271e
chore(deps): bump immutable from 4.3.4 to 4.3.8 (#37782)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 10:56:22 +05:30
dependabot[bot]
533b3bed5a
chore(deps): bump svgo from 2.8.0 to 2.8.2 (#37783)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-05 10:56:09 +05:30
Soham Kulkarni
8788b4a6fa
Merge pull request #36946 from EYYCHEEV/fix/sidebar-page-route-entity-name 2026-03-05 10:12:00 +05:30
Soham Kulkarni
927d610494
Merge pull request #37743 from KerollesFathy/fix/nested-menu-hide-on-switch 2026-03-05 10:10:49 +05:30
Soham Kulkarni
90761c1b7f
Merge pull request #37780 from sokumon/desktop-editing
fix: desktop editing trigger
2026-03-05 09:06:02 +05:30
sokumon
96169dd6ec fix: desktop editing trigger 2026-03-05 02:28:31 +05:30
Ejaaz Khan
050305cf2d
Merge pull request #37770 from KerollesFathy/fix-show-create-new-workspace-btn
fix: add "New" workspace button to menu items
2026-03-04 22:31:35 +05:30
Ejaaz Khan
a5d591230b
Merge pull request #37745 from kaulith/fix/print-format-builder-beta-header
fix: pass letterhead and render layout header/footer in print format
2026-03-04 22:28:58 +05:30
Kerolles Fathy
32d0258d8c
fix: remove stale custom_onhide in msgprint to prevent rerouting issues (#37487)
Co-authored-by: Veturi Jaswanth Sriram <veturijaswanthsriram@gmail.com>
2026-03-04 22:21:10 +05:30
Hussain Nagaria
2b383ed62a
Merge pull request #37769 from KerollesFathy/fix-try-print-designer 2026-03-04 20:39:03 +05:30
KerollesFathy
3faa12b3b8 fix: add "New" workspace btn to menu items 2026-03-04 14:44:56 +00:00
KerollesFathy
bb028cbb47 fix: remove "Try New Print Designer" link
Frappe should only nudge users to install Print Designer,
not navigate to it. This link was also triggered under a wrong "disable product suggestions" condition check
2026-03-04 13:24:18 +00:00
Gursheen Kaur Anand
10dd6cbdb2
fix(Web Form): default key __user to display current user for link field (#37640)
* fix: allow __user as default value for web form link fields

* refactor: cleanup default value setting into separate function
2026-03-04 18:27:40 +05:30
Saqib Ansari
b7111330bd
fix: don't throw if request fails (#37761) 2026-03-04 18:04:27 +05:30
Clayton
852d264698
feat: add activity log support (#37696) 2026-03-04 11:45:11 +00:00
RitvikSardana
5e92776a4b
Merge pull request #37561 from RitvikSardana/user-invitation-fields
fix(invitation): add **kwargs param to invite_user API to add app specific fields
2026-03-04 17:14:32 +05:30
s-aga-r
c13cdd1adc
Merge pull request #37752 from s-aga-r/fix-37296
fix(email): validate IMAP folders using `SELECT` instead of `LIST` parsing
2026-03-04 10:32:38 +00:00
Safwan
5efd030056
Revert "fix: cast dates in print preview" (#37750) 2026-03-04 07:04:16 +00:00
Akash Tom
f69736b879
Merge pull request #37655 from krantheman/fix-link-duplication 2026-03-04 12:21:02 +05:30
Akhil Narang
cacb6b65f8
Merge pull request #37747 from akhilnarang/oauth-first-name-fallback
fix(oauth): add another fallback for first name
2026-03-04 11:48:34 +05:30
Akhil Narang
1707a7cb96
fix(oauth): add another fallback for first name
Github doesn't mandate a first name, but frappe does, so fallback to username.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2026-03-04 11:38:40 +05:30
Kaushal Shriwas
84fb0d000c fix: pass letterhead and render layout header/footer in print format builder beta browser print 2026-03-04 02:02:01 +05:30
KerollesFathy
abf7c414b7 fix: hide previous nested menu when switching to another 2026-03-03 14:16:03 +00:00
Ejaaz Khan
159a56a59f
Merge pull request #37730 from frappe/revert-37713-37464-default-pdf-issue
Revert "feat: use chrome from system/docker file"
2026-03-03 17:30:33 +05:30