Skip to content

enhance: patch help_improve bug PR1455#1456

Merged
Wendong-Fan merged 2 commits intopatch-help_improvefrom
patch-help_improve_wd
Mar 5, 2026
Merged

enhance: patch help_improve bug PR1455#1456
Wendong-Fan merged 2 commits intopatch-help_improvefrom
patch-help_improve_wd

Conversation

@Wendong-Fan
Copy link
Copy Markdown
Contributor

@Wendong-Fan Wendong-Fan commented Mar 5, 2026

Builds on #1455 by adding a backend-side fix to fully resolve #1454. The frontend-only fix in #1455 addresses new
versions but cannot fix already-released clients that iterate all response keys with Object.keys(res). This PR
fixes the root cause at the API layer.

Changes

Backend (server/app/model/user/privacy.py)

  • Add REQUIRED_FIELDS as the single source of truth for which privacy fields are required
  • Add all_required_granted() method to compute whether all required permissions are granted
  • Add to_response() to return only model-defined fields plus the computed all_required_granted flag
  • Extra fields like help_improve stored in the DB JSON column are now filtered out at the API layer

Backend (server/app/controller/user/user_controller.py)

  • GET and PUT /api/user/privacy now return UserPrivacySettings.to_response() instead of raw
    model.pricacy_setting

@Wendong-Fan Wendong-Fan requested a review from a7m-1st March 5, 2026 14:39
@Wendong-Fan Wendong-Fan mentioned this pull request Mar 5, 2026
8 tasks
@a7m-1st a7m-1st force-pushed the patch-help_improve_wd branch from effa029 to be2e3c6 Compare March 5, 2026 14:54
@Wendong-Fan Wendong-Fan merged commit 9671b05 into patch-help_improve Mar 5, 2026
1 check passed
Copy link
Copy Markdown
Collaborator

@a7m-1st a7m-1st left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Wendong-Fan , LGTM.
Essentially this offloads hardcoding permissions in clientside.

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.

2 participants