Skip to content

Hotfix/myscript fix - #8

Merged
taenguree merged 2 commits into
mainfrom
hotfix/myscript-fix
Sep 15, 2026
Merged

taenguree merged 2 commits into
mainfrom
hotfix/myscript-fix

Conversation

@taenguree

Copy link
Copy Markdown
Contributor

No description provided.

taenguree and others added 2 commits September 15, 2026 13:08
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>
@taenguree taenguree self-assigned this Sep 15, 2026
@taenguree taenguree added the 🐞 버그 Something isn't working label Sep 15, 2026
@taenguree
taenguree merged commit c6b9fd9 into main Sep 15, 2026
1 check passed
@taenguree
taenguree deleted the hotfix/myscript-fix branch September 15, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 버그 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant