Skip to content

Conversation

@huhuanming
Copy link
Contributor

  • Android: Add disposal checks to prevent operations after cleanup
  • Android: Implement retry limit to prevent infinite shimmer start loops
  • Android: Enhance cleanup in stopShimmer() and dispose() methods
  • iOS: Fix potential deadlock in deinit by using async dispatch
  • iOS: Improve cleanup of view layers and animations

huhuanming and others added 11 commits December 27, 2025 23:11
- Android: Add disposal checks to prevent operations after cleanup
- Android: Implement retry limit to prevent infinite shimmer start loops
- Android: Enhance cleanup in stopShimmer() and dispose() methods
- iOS: Fix potential deadlock in deinit by using async dispatch
- iOS: Improve cleanup of view layers and animations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@originalix originalix requested a review from Copilot January 4, 2026 00:26
@originalix
Copy link

@codex review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves memory safety and cleanup mechanisms in the Skeleton component and fixes several issues in the DeviceUtils module. The changes focus on preventing crashes from lifecycle issues, race conditions, and improper thread handling during component disposal.

Key Changes:

  • Implemented disposal guards and retry limits to prevent infinite loops and operations after cleanup in Skeleton components
  • Fixed potential deadlock in iOS Skeleton deinit by using async dispatch for non-main thread cleanup
  • Added input validation and improved cleanup in DeviceUtils color change functionality

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
native-views/react-native-skeleton/ios/Skeleton.swift Added retry limits, improved deinit cleanup with async dispatch to avoid deadlocks, enhanced layer cleanup
native-views/react-native-skeleton/android/src/main/java/com/margelo/nitro/skeleton/Skeleton.kt Added isDisposed flag with disposal checks, retry limits, improved animator cleanup
native-modules/react-native-device-utils/ios/ReactNativeDeviceUtils.swift Added color value clamping and fixed optional chaining for safer color changes
native-modules/react-native-device-utils/android/src/main/java/com/margelo/nitro/reactnativedeviceutils/ReactNativeDeviceUtils.kt Improved thread safety with CopyOnWriteArrayList, better WindowInfoTracker cleanup, added color clamping
native-modules/react-native-device-utils/android/src/main/java/com/margelo/nitro/reactnativedeviceutils/ReactNativeDeviceUtilsPackage.kt Removed unused setReactContext call
example/react-native/pages/DeviceUtilsTestPage.tsx Fixed method name from onSpanningChanged to addSpanningChangedListener
.gitignore Added gradle directory to ignore list
.claude/commands/commit.md Added new documentation file for commit command guidelines

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5639ff1250

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@originalix
Copy link

@huhuanming 看看 copliot 和 codex 的 review 问题

@huhuanming
Copy link
Contributor Author

修了下,确实有问题

@OneKeyHQ OneKeyHQ deleted a comment from chatgpt-codex-connector bot Jan 4, 2026
@huhuanming
Copy link
Contributor Author

@claude review

@huhuanming huhuanming changed the title 🐛 fix: improve memory safety and cleanup in Skeleton component fix: improve memory safety and cleanup in Skeleton component Jan 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

3 participants