Skip to content

refactor(group): optimize group notification and cache handling#3705

Open
dsx137 wants to merge 2 commits intoopenimsdk:3.8.3-patchfrom
dsx137:perf/3.8.3-patch/set-notification
Open

refactor(group): optimize group notification and cache handling#3705
dsx137 wants to merge 2 commits intoopenimsdk:3.8.3-patchfrom
dsx137:perf/3.8.3-patch/set-notification

Conversation

@dsx137
Copy link
Copy Markdown
Contributor

@dsx137 dsx137 commented Mar 20, 2026

  • Improve notification sender with bulk operations and fallback logic
  • Enhance group cache with new methods for member counts and version handling
  • Refactor group controller with better cache integration
  • Add more robust error handling and logging

fix(group): optimize group cache implementation

This commit refactors the GroupCacheRedis implementation to improve code organization and maintainability. The changes include:

  • Added proper import organization and removed unused imports
  • Implemented batchGetCache2 function calls for efficient data retrieval
  • Added comprehensive cache key management functions
  • Improved version tracking for group members and requests
  • Enhanced error handling and logging
  • Added batch operations for better performance
  • Refactored complex functions into smaller, more manageable pieces

The changes focus on improving the overall structure and performance of the group cache system while maintaining backward compatibility.

refactor(group): improve notification error handling and add admin context

  • Convert notification methods to return errors for better error propagation
  • Add admin context checking for bulk notifications
  • Enhance group info retrieval with proper error handling
  • Improve notification sender with fallback user information

fix(group): handle nil group member map in notification

Add nil check for groupMemberMap[groupInfo.GroupID] before accessing to prevent nil pointer panic. Skip iteration if map is nil.

refactor(group): update group notification methods to use UserInfo struct

Renamed function parameter from groupMemberUserID string to changedUserInfo *sdkws.UserInfo Updated function logic to use changedUserInfo.UserID instead of separate parameter Refactored notification methods to use consistent UserInfo struct pattern Added proper error handling for opUser retrieval
Updated function signatures and internal logic for GroupMemberInfoSetNotificationBulk

fix: batchGetGroupRoleLevelMemberIDs with BatchCache

fix: GetGroupMemberNums BatchCache

perf(group): optimize notification logic for group member operations

Conflicts:

internal/rpc/group/group.go

pkg/common/storage/cache/redis/group.go

Conflicts:

internal/rpc/group/group.go

pkg/common/storage/cache/redis/group.go

🅰 Please add the issue ID after "Fixes #"

Fixes #

- Improve notification sender with bulk operations and fallback logic
- Enhance group cache with new methods for member counts and version handling
- Refactor group controller with better cache integration
- Add more robust error handling and logging

fix(group): optimize group cache implementation

This commit refactors the GroupCacheRedis implementation to improve code organization and maintainability. The changes include:

- Added proper import organization and removed unused imports
- Implemented batchGetCache2 function calls for efficient data retrieval
- Added comprehensive cache key management functions
- Improved version tracking for group members and requests
- Enhanced error handling and logging
- Added batch operations for better performance
- Refactored complex functions into smaller, more manageable pieces

The changes focus on improving the overall structure and performance of the group cache system while maintaining backward compatibility.

refactor(group): improve notification error handling and add admin context

- Convert notification methods to return errors for better error propagation
- Add admin context checking for bulk notifications
- Enhance group info retrieval with proper error handling
- Improve notification sender with fallback user information

fix(group): handle nil group member map in notification

Add nil check for groupMemberMap[groupInfo.GroupID] before accessing to prevent nil pointer panic. Skip iteration if map is nil.

refactor(group): update group notification methods to use UserInfo struct

Renamed function parameter from groupMemberUserID string to changedUserInfo *sdkws.UserInfo
Updated function logic to use changedUserInfo.UserID instead of separate parameter
Refactored notification methods to use consistent UserInfo struct pattern
Added proper error handling for opUser retrieval
Updated function signatures and internal logic for GroupMemberInfoSetNotificationBulk

fix: batchGetGroupRoleLevelMemberIDs with BatchCache

fix: GetGroupMemberNums BatchCache

perf(group): optimize notification logic for group member operations

# Conflicts:
#	internal/rpc/group/group.go
#	pkg/common/storage/cache/redis/group.go

# Conflicts:
#	internal/rpc/group/group.go
#	pkg/common/storage/cache/redis/group.go
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant