Implement methods from parent diff
Details
Temporarily modify NotificationService and AppDelegate so that the first writes notification to a file from which the second reads upon app launch. Cover reads and writes with semaphore operations. Use debugger to hold semaphore in AppDelegate, trigger notification and see that NotificationService did not acquire semaphore (simply logs it).
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm | ||
---|---|---|
15–42 ↗ | (On Diff #14160) | Spacing here looks broken. Is this really how XCode is formatting it? Can we try to improve this? |
native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm | ||
---|---|---|
15–42 ↗ | (On Diff #14160) | I don't use XCode for formatting - I rely on yarn clang-format-all command.
What exactly do you refer to? I think you may refer to NSLocalizedDescriptionKey : [NSString. Actually spacing is correct here. Additional space is introduced between NSLocalizedDescriptionKey and : since it is not a method call but initialization of Objective - C dictionary. We do no introduce before after : if it precedes argument in method call, but we do so if it precedes value under a given key in Objective-C dictionary initialization. Example: https://stackoverflow.com/questions/9195573/initializing-nsdictionary. |
native/ios/Comm/TemporalMessageStorage/NonBlockingLock.mm | ||
---|---|---|
15–42 ↗ | (On Diff #14160) | Ah okay, that's fair... sorry for my confusion |
You don't need to use React.useMemo(...) here.
The useMemo() hook is helpful for maintaining referential equality so that objects will be considered "shallowly equal" (== in JS) and we can avoid re-renders. This is helpful for objects (including Map(), Set(), etc), arrays (which are objects), and functions (which are objects).
On the other hand, strings in JS are considered shallowly equal if they have the same contents, so we don't have to worry about re-renders if the "content" stays the same.
See below:
(In like C++, which you've been working w/ recently, std::strings can be allocated on the heap (unlike integers, booleans, etc) which may have been part of your reasoning that shallow equality would check reference instead of contents?)