{"record":{"id":"96d4a38f25a7894c","repo":"facebook/relay","slug":"mango-not-found","errorCode":null,"errorMessage":"mango not found","messagePattern":"mango not found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/schema-set/src/build_schema_document.rs","lineNumber":963,"sourceCode":"        assert!(\n            interface_pos < extension_pos,\n            \"Definitions should print before extensions: {}\",\n            sdl,\n        );\n    }\n\n    #[test]\n    fn test_object_fields_sorted_alphabetically() {\n        let sdl = schema_sdl(indoc! {r#\"\n            type Foo {\n              zebra: String\n              apple: Int\n              mango: Boolean\n            }\n        \"#});\n        // Fields should be sorted alphabetically\n        let apple_pos = sdl.find(\"apple\").expect(\"apple not found\");\n        let mango_pos = sdl.find(\"mango\").expect(\"mango not found\");\n        let zebra_pos = sdl.find(\"zebra\").expect(\"zebra not found\");\n        assert!(\n            apple_pos < mango_pos && mango_pos < zebra_pos,\n            \"Fields should be sorted: {}\",\n            sdl,\n        );\n    }\n\n    // --- Interface ---\n\n    #[test]\n    fn test_interface_with_fields() {\n        let sdl = schema_sdl(indoc! {r#\"\n            interface Node {\n              id: ID!\n            }\n        \"#});\n        assert!(sdl.contains(\"interface Node\"), \"Got: {}\", sdl);","sourceCodeStart":945,"sourceCodeEnd":981,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/schema-set/src/build_schema_document.rs#L945-L981","documentation":"Panic from `.expect(\"mango not found\")` in `test_object_fields_sorted_alphabetically` (compiler/crates/schema-set/src/build_schema_document.rs:963), same test as error 163. The printed SDL does not contain the `mango` field substring, so the alphabetical-ordering assertion (apple < mango < zebra) cannot proceed. The library panics because a missing field means either the printer dropped it or the input SDL no longer contains it.","triggerScenarios":"Same as error 163: `to_sdl_definition()` output for `type Foo { zebra: String apple: Int mango: Boolean }` lacks `mango`. Also occurs if `mango` was renamed or the printer emits fields in a way that renames/escapes them.","commonSituations":"Field-dropping regression in the SDL printer; editing the test's `indoc!` SDL and forgetting to update all three lookup strings; case sensitivity issues (`Mango` vs `mango`) after a naming-convention change.","solutions":["Dump the `sdl` string before the `.find` calls and confirm which fields are actually printed.","Verify the test SDL still declares `mango: Boolean` with exact spelling/casing.","Fix the printer in build_schema_document.rs if object fields are being omitted, then re-run `cargo test -p schema-set`.","Harden the assertions with `.unwrap_or_else(|| panic!(... sdl ...))` so output is shown on any future miss."],"exampleFix":"// before\nlet mango_pos = sdl.find(\"mango\").expect(\"mango not found\");\n// after\nlet mango_pos = sdl\n    .find(\"mango\")\n    .unwrap_or_else(|| panic!(\"mango not found in SDL:\\n{}\", sdl));","handlingStrategy":"validation","validationCode":"// Validate presence of every field before ordering assertions:\nassert!(sdl.contains(\"mango\"), \"SDL missing 'mango'\\n{}\", sdl);","typeGuard":"fn sdl_field_position<'a>(sdl: &'a str, field: &str) -> Option<usize> {\n    sdl.find(field)\n}","tryCatchPattern":"let mango_pos = sdl\n    .find(\"mango\")\n    .unwrap_or_else(|| panic!(\"mango not found; SDL:\\n{}\", sdl));","preventionTips":["Verify exact field spelling/case in the fixture SDL matches the `.find` argument.","Embed the SDL in the assertion message so drops are visible immediately.","Re-run schema-set tests after any printer ordering change since these assertions are position-sensitive.","Prefer asserting on structured printer output (if an API exists) over raw substring positions when possible."],"tags":["rust","panic","sdl-printer","test-assertion"],"backgroundTag":"expect-panic-not-found","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}