{"record":{"id":"b800b98faf11975d","repo":"lingochamp/FileDownloader","slug":"can-t-restore-the-snapshot-because-unknown-status","errorCode":null,"errorMessage":"Can't restore the snapshot because unknown status: %d","messagePattern":"Can't restore the snapshot because unknown status: (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"library/src/main/java/com/liulishuo/filedownloader/message/MessageSnapshot.java","lineNumber":185,"sourceCode":"                    } else {\n                        snapshot = new SmallMessageSnapshot.CompletedSnapshot(source);\n                    }\n                    break;\n                case FileDownloadStatus.warn:\n                    if (largeFile) {\n                        snapshot = new LargeMessageSnapshot.WarnMessageSnapshot(source);\n                    } else {\n                        snapshot = new SmallMessageSnapshot.WarnMessageSnapshot(source);\n                    }\n                    break;\n                default:\n                    snapshot = null;\n            }\n\n            if (snapshot != null) {\n                snapshot.isLargeFile = largeFile;\n            } else {\n                throw new IllegalStateException(\"Can't restore the snapshot because unknown \"\n                        + \"status: \" + status);\n            }\n\n            return snapshot;\n        }\n\n        @Override\n        public MessageSnapshot[] newArray(int size) {\n            return new MessageSnapshot[size];\n        }\n    };\n\n    public static class NoFieldException extends IllegalStateException {\n        NoFieldException(String methodName, MessageSnapshot snapshot) {\n            super(FileDownloadUtils.formatString(\"There isn't a field for '%s' in this message\"\n                            + \" %d %d %s\",\n                    methodName, snapshot.getId(), snapshot.getStatus(),\n                    snapshot.getClass().getName()));","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/lingochamp/FileDownloader/blob/6237a8cac174bcc916e4342b14ab1ab72a5768d4/library/src/main/java/com/liulishuo/filedownloader/message/MessageSnapshot.java#L167-L203","documentation":"Raised in MessageSnapshot.createFromParcel when the status int read from the Parcel does not match any known FileDownloadStatus constant, so no snapshot class can be constructed for it. Typically means the parcel was written by a different/newer version of the library whose status codes this version does not recognize, or the parcel data is corrupted/misaligned.","triggerScenarios":"Thrown at library/src/main/java/com/liulishuo/filedownloader/message/MessageSnapshot.java:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the FileDownloader library version identical between the process that wrote the parcel and the one restoring it (e.g. after an app update, clear in-flight download state)","If you forward parcels between processes, ensure both use the same library version and the parcel is written with writeParcelable and read in matching order","Discard stale download snapshots on upgrade and re-query download state from the database instead of restoring old parcels","Add handling for unknown status codes (default branch) so restoration fails gracefully instead of with an error"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6237a8cac174bcc916e4342b14ab1ab72a5768d4","analyzedAt":"2026-09-08T23:50:48.168Z","contentChangedAt":"2026-09-08T23:50:48.168Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}