Hotfix/myscript fix - #8
Merged
Merged
Conversation
iink 4.5 가 ACTION_DOWN 마다 새로 호출하는 requestUnbufferedDispatch 가 API 27/28/29 의 ViewRootImpl 버그를 건드려 답안패드 첫 획에서 약 20초 먹통이 되는 ANR 이 발생했다. (SM-P580 / Android 8.1 에서 재현) 원인: 해당 버전의 scheduleConsumeBatchedInputImmediately() 는 - 예약된 프레임 배치 소비를 취소하고(unscheduleConsumeBatchedInput) - 대신 실행하는 doConsumeBatchedInput(-1) 이 방금 내려간 mConsumeBatchedInputScheduled 를 가드로 쓰기 때문에 아무것도 소비하지 않는다 그 결과 네이티브에 쌓인 입력 배치가 회수되지 않아 finishInputEvent 가 불리지 않고, InputDispatcher 가 대기하다 타임아웃된다. 이때 메인스레드는 막힌 게 아니라 할 일이 없어 유휴 상태였다(실측 CPU 2.7%). API 30 에서 수정된 프레임워크 버그이며 27/28/29 소스 대조로 확인했다. 3.0.2 에는 이 호출 자체가 없어 롤백 후 증상이 사라졌다. API 30 이상에서는 저지연 캡처를 그대로 유지한다. 상세: Summit-Android trouble-shootings/myscript-iink-4.5-anr-rollback.md Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
답안패드에 "2+" 처럼 피연산자 한쪽을 비운 채 candidate 버튼을 누르면
Expression.getOperands() NPE 로 죽는 크래시가 iink 4.5.0 이후 발생했다.
원인: 미해결 피연산자 자리를 두 버전이 다르게 직렬화한다.
- 3.0.2 : {"type":"number","label":"?","generated":true,"error":"Unsolved"}
- 4.5.0 : null
Gson 은 Kotlin non-null 제네릭을 강제하지 않아 List<Expression> 안에
java null 이 그대로 들어오고, getAllExpressions 의 평탄화에서 터진다.
원소 타입을 nullable 로 선언해 wire 포맷을 있는 그대로 반영하고,
순회하는 쪽에서 filterNotNull 로 걸러낸다. getAllExpressions 의 반환
타입은 List<Expression> 그대로라 하위 호출부는 수정이 없다.
3.0.2 의 플레이스홀더 객체는 id/items/symbols 가 모두 없어 순회에
아무것도 기여하지 않았으므로, null 을 버리는 것은 3.0.2 동작의 복원이다.
changeItem 은 null 을 자리 그대로 보존해 import_ 라운드트립 구조를
유지한다. 다만 Gson 은 배열 안 null 을 리터럴 null 로 직렬화하므로
iink 임포터가 이를 받는지는 실기기 확인이 필요하다.
상세: Summit-Android trouble-shootings/myscript-iink-4.5-jiix-null-operand-npe.md
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.