Automattic / Automattic/simplenote-ios
Checklists: Undo Crash
- Dominant language
- Swift
- Stars
- 2.2k
- Forks
- 297
- Avg merge
- 13h 25m
- Merged PRs (30d)
- 6
Description
Reported in #664
h/t @aerych (Thank you Eric!!)
> Create a new note. Past some text. Ctrl+Z to undo. No problem. Now repeat, but this time paste the example checklist, then try to undo. 💥
```
2020-02-27 15:37:20.654677-0600 Simplenote[40942:609394] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString substringWithRange:]: Range {0, 44} out of bounds; string length 28'
*** First throw call stack:
(
0 CoreFoundation 0x000000010829b1e6 __exceptionPreprocess + 294
1 libobjc.A.dylib 0x00000001086f3031 objc_exception_throw + 48
2 CoreFoundation 0x0000000108310975 +[NSException raise:format:] + 197
3 CoreFoundation 0x00000001081fd113 -[__NSCFString substringWithRange:] + 163
4 UIKit 0x0000000105d17c5e -[NSTextStorage(UIKitUndoExtensions) _undoRedoAttributedSubstringFromRange:] + 136
5 UIKit 0x0000000105d180bd -[_UITextUndoOperationReplace undoRedo] + 319
6 Foundation 0x00000001040bb695 -[_NSUndoStack popAndInvoke] + 280
7 Foundation 0x00000001040bb424 -[NSUndoManager undoNestedGroup] + 433
8 UIKit 0x0000000128f72863 -[NSUndoManagerAccessibility undo] + 64
9 UIKit 0x00000001051c9e87 -[UIKeyboardImpl handleKeyCommand:repeatOkay:beforePublicKeyCommands:] + 5297
10 UIKit 0x0000000104ee50c8 -[UIApplication _handleKeyUIEvent:] + 694
11 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
12 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
13 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
14 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
15 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
16 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
17 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
18 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
19 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
20 UIKit 0x00000001050f8cdb -[UIResponder _handleKeyUIEvent:] + 79
21 UIKit 0x0000000104ee4b3c -[UIApplication handleKeyUIEvent:] + 103
22 UIKit 0x0000000104ee4ab5 -[UIApplication handleKeyHIDEvent:] + 692
23 UIKit 0x0000000128ef3c80 -[UIApplicationAccessibility handleKeyHIDEvent:] + 41
24 UIKit 0x0000000105824fa8 __dispatchPreprocessedEventFromEventQueue + 997
25 UIKit 0x00000001058282c4 __handleEventQueueInternal + 5949
26 CoreFoundation 0x000000010823dbb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
27 CoreFoundation 0x00000001082224af __CFRunLoopDoSources0 + 271
28 CoreFoundation 0x0000000108221a6f __CFRunLoopRun + 1263
29 CoreFoundation 0x000000010822130b CFRunLoopRunSpecific + 635
30 GraphicsServices 0x000000010cc28a73 GSEventRunModal + 62
31 UIKit 0x0000000104ec9057 UIApplicationMain + 159
32 Simplenote 0x0000000101d33ef0 main + 112
33 libdyld.dylib 0x000000010a14f955 start + 1
34 ??? 0x0000000000000001 0x0 + 1
)
```
Contributor guide
Research direction
Reproduce the crash by creating a note, pasting the example checklist, and pressing Ctrl+Z, then use the provided UIKit undo stack trace to investigate the affected editor path. Done means undo no longer crashes and the pasted checklist can be undone normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100