Repository navigation
test(users): clear devices after the HWID count tests - #994
Merged
Merged
Conversation
SQLite keeps a deleted user's devices (foreign keys off) and can give its id to the next test's user, so the two device count tests from #951 left devices that a later test inherited: running them before tests/api/test_hwid.py made test_hwid_respects_admin_role_policy see 3 devices instead of 1. Clear the devices before deleting the users.
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 2, 2026
…ain bba95f274 Checked with git ls-remote on 2026-10-11 02:55 UTC. Panel dev moved from d94e157 to 83fe90e with 22 commits; main is still v5.4.1. - PasarGuard#879 (2d0ca81, loopback Xray client inbounds) is ported by design: the fork took the open pull request on 2026-09-25 as 2e7fc45 with migration bfd88026565b, the same listener rewrite. - PasarGuard#934 (a5b28f3) moves from the port queue to a dated waiver until 2026-11-09: the fork refuses to delete a core that nodes still use (W3-013, fix/node-health) instead of restarting those nodes. - PasarGuard#993 (Hysteria2 FinalMask without a udp mask) is queued until 2026-10-18: the fork has the same FinalMask | dict field and the same non-null-safe udpHop reads, so a udpHop-only host can fail the whole subscription. - PasarGuard#984, PasarGuard#985, PasarGuard#986, PasarGuard#989, PasarGuard#944, PasarGuard#864, PasarGuard#948, PasarGuard#951, PasarGuard#778, PasarGuard#774, PasarGuard#787, PasarGuard#994, PasarGuard#865, PasarGuard#875, PasarGuard#718, PasarGuard#967, PasarGuard#772, PasarGuard#662, PasarGuard#995 and PasarGuard#913 are queued as security: no until 2026-10-25, each with its reason; PasarGuard#913's node-removal half is already in the fork through sync_remove_users. - The branch commits that upstream squash-merged (the three dashboard branches, telegram/tests, fix/core-editor-api-section-followup, fix/hwid-count-test-cleanup, fix/hysteria-finalmask-quic-only) follow their squash, by patch-id or by an equal tree. Scripts main moved to bba95f274 (PasarGuard#35, PasarGuard#36, PasarGuard#37 after PasarGuard#34). The three squashes are queued security: no until 2026-10-25, and their pre-squash branch commits are waived as superseded (equal trees). Against live upstream the panel gate now fails only on the 17 port-queue commits classified security: yes, and the forks gate only on node f72ac0ef (security: yes). No upstream commit is undecided.
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
SQLite keeps a deleted user's devices (foreign keys off) and can give its id to the next test's user, so the two device count tests from PasarGuard#951 left devices that a later test inherited: running them before tests/api/test_hwid.py made test_hwid_respects_admin_role_policy see 3 devices instead of 1. Clear the devices before deleting the users. (cherry picked from commit 3ef603b) Fork port: tests/api/test_permission_leaks.py is not in the fork; the same clean-up is in tests/api/test_user_list_hwid_count_scope.py. (cherry picked from commit 8aa3b56483275da41b5d4e749b8be06d4f829c94)
Free-Guy-IR
added a commit
to Free-Guy-IR/panel
that referenced
this pull request
Nov 4, 2026
… users Ports the device count test of upstream tests/api/test_permission_leaks.py (PasarGuard#951, with the PasarGuard#994 clean-up), which the fork does not have, and adds an own-scope admin with hwids.read that sorts by hwid_count both ways over a search that also matches three other admins' users with more devices: the total stays 1 and only its own user and count are returned. (cherry picked from commit c2f34e699400c06bdb179769acaf2bfd596e16c6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/api/test_permission_leaks.py::test_user_list_shows_device_counts_only_with_hwids_readbeforetests/api/test_hwid.pymadetest_hwid_respects_admin_role_policyfail withassert 3 == 1. The default file order happens to runtest_hwid.pyfirst, so the full suite passed.Tests
test_hwid.py, andtests/api/test_user.py tests/api/test_permission_leaks.py tests/api/test_hwid.pyin that order all pass (143 passed for the last one).