Skip to content

Fix #216: Implement robust JSON serialization for user settings#228

Merged
thomwiggers merged 1 commit intodevelopfrom
fix/issue-216-redis-serialization
Feb 18, 2026
Merged

Fix #216: Implement robust JSON serialization for user settings#228
thomwiggers merged 1 commit intodevelopfrom
fix/issue-216-redis-serialization

Conversation

@thomwiggers
Copy link
Copy Markdown
Owner

Resolves #216.

This PR implements a robust JSON-based serialization strategy for user settings and permissions, ensuring compatibility with database backends that only support string values (e.g., Redis).

Changes:

  • onebot.plugins.users:
    • Introduced json for serializing all non-string types (lists, dicts, booleans, etc.).
    • Added a deserialize_setting helper (and extended bot method) for safe JSON decoding.
  • onebot.plugins.acl:
    • Updated to use the new serialization logic for superadmin and permission management.
  • Tests:
    • Updated tests/test_plugin_acl.py to align with the JSON storage format.
    • Verified that all tests pass.

@github-actions
Copy link
Copy Markdown

🤖 Hi @thomwiggers, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@github-actions
Copy link
Copy Markdown

🤖 I'm sorry @thomwiggers, but I was unable to process your request. Please see the logs for more details.

- Implement JSON-based serialization for complex data types in Users plugin
- Update ACL plugin to use JSON for superadmin and permissions management
- Add deserialize_setting helper for robust decoding across the bot
- Update tests to reflect JSON storage format
@thomwiggers thomwiggers force-pushed the fix/issue-216-redis-serialization branch from f2fcfad to d39ee9e Compare February 18, 2026 12:16
@thomwiggers thomwiggers merged commit 5d10ba4 into develop Feb 18, 2026
17 checks passed
@thomwiggers thomwiggers deleted the fix/issue-216-redis-serialization branch February 18, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting superadmin may be broken

1 participant