{"record":{"id":"0c979ad31eafb0c5","repo":"passbolt/passbolt_api","slug":"the-record-is-currently-not-ignored-as-part-of-directory","errorCode":null,"errorMessage":"The record is currently not ignored as part of directory synchronization.","messagePattern":"The record is currently not ignored as part of directory synchronization\\.","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"info","filePath":"plugins/PassboltEe/DirectorySync/src/Controller/DirectoryIgnoreController.php","lineNumber":104,"sourceCode":"     * @throws \\Cake\\Http\\Exception\\ForbiddenException if the current user is not an admin\n     * @return void\n     */\n    public function view(string $foreignModel, string $foreignKey): void\n    {\n        if ($this->User->role() !== Role::ADMIN) {\n            throw new ForbiddenException(__('You are not authorized to access that location.'));\n        }\n        $this->assertDirectoryEnabled();\n        $foreignModel = $this->normalizeForeignModel($foreignModel);\n        if (!Validation::inList($foreignModel, ['Groups', 'Users', 'DirectoryEntries'])) {\n            throw new BadRequestException(__('The record model is not valid.'));\n        }\n\n        try {\n            $ignored = $this->DirectoryIgnore->get($foreignKey);\n        } catch (RecordNotFoundException $exception) {\n            $msg = __('The record is currently not ignored as part of directory synchronization.');\n            throw new NotFoundException($msg);\n        }\n        $this->success(__('The record is currently ignored as part of directory synchronization.'), $ignored);\n    }\n\n    /**\n     * Mark a record as ignored.\n     *\n     * @param string $foreignModel foreign model\n     * @param string $foreignKey foreign key\n     * @throws \\App\\Error\\Exception\\ValidationException If the model name or id is not valid\n     * @throws \\Cake\\Http\\Exception\\ForbiddenException if the current user is not an admin\n     * @return void\n     */\n    public function add(string $foreignModel, string $foreignKey): void\n    {\n        if ($this->User->role() !== Role::ADMIN) {\n            throw new ForbiddenException(__('You are not authorized to access that location.'));\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/plugins/PassboltEe/DirectorySync/src/Controller/DirectoryIgnoreController.php#L86-L122","documentation":"This NotFoundException (HTTP 404) is thrown in view() when DirectoryIgnore->get($foreignKey) finds no ignore record for the given id, meaning that user/group/directory-entry is currently NOT ignored by directory synchronization. The endpoint only succeeds when an ignore entry exists, so absence of an entry is reported as not-found.","triggerScenarios":"GET /directoryignore/users/{uuid} where no row exists in the directory_ignore table for that uuid (record was never ignored, or its ignore entry was already deleted).","commonSituations":"Polling ignore status for a record after another admin already un-ignored it; checking a newly created user/group never marked as ignored; stale id lists cached by an integration.","solutions":["Treat 404 here as the success state 'not ignored' rather than a hard failure","Confirm the correct foreignKey uuid (list users/groups/directory entries first)","Re-check after running a directory sync if you expected an auto-created ignore entry","Create the ignore entry via POST /directoryignore/{model}/{uuid} before querying it"],"exampleFix":"// client-side handling\ntry { $status = $api->getIgnoreStatus($model, $id); }\ncatch (NotFoundException $e) { $status = false; // record is not ignored\n}","handlingStrategy":"try-catch","validationCode":"$ignored = array_filter($api->get('/directoryignore.json')['ignoredRecords'] ?? [],\n    fn($r) => $r['foreign_key'] === $id);","typeGuard":null,"tryCatchPattern":"try {\n    $api->get(\"/directoryignore/{$model}/{$id}.json\");\n    // record IS ignored\n} catch (NotFoundException $e) {\n    // 404 means: record is NOT ignored (expected state, not failure)\n}","preventionTips":["Model the ignore check as a boolean lookup, not a hard fetch","Treat 404 on this endpoint as a valid 'not ignored' answer","Refresh cached ignore lists before status checks"],"tags":["not-found","directory-sync","ignore-list","expected-condition"],"backgroundTag":"resource-not-found","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}