{"record":{"id":"dd774e66063bca0c","repo":"appwrite/appwrite","slug":"subscriber-not-found-with-the-request-id-could-be","errorCode":"subscriber_not_found","errorMessage":"Subscriber with the request ID could not be found.","messagePattern":"Subscriber with the request ID could not be found\\.","errorType":"exception","errorClass":"Appwrite\\Extend\\Exception","httpStatus":404,"severity":"error","filePath":"src/Appwrite/Platform/Modules/Messaging/Http/Topics/Subscribers/Get.php","lineNumber":66,"sourceCode":"            ->param('subscriberId', '', fn (Database $dbForProject) => new UID($dbForProject->getAdapter()->getMaxUIDLength()), 'Subscriber ID.', false, ['dbForProject'])\n            ->inject('dbForProject')\n            ->inject('authorization')\n            ->inject('response')\n            ->callback($this->action(...));\n    }\n\n    public function action(string $topicId, string $subscriberId, Database $dbForProject, Authorization $authorization, Response $response)\n    {\n        $topic = $authorization->skip(fn () => $dbForProject->getDocument('topics', $topicId));\n\n        if ($topic->isEmpty()) {\n            throw new Exception(Exception::TOPIC_NOT_FOUND);\n        }\n\n        $subscriber = $dbForProject->getDocument('subscribers', $subscriberId);\n\n        if ($subscriber->isEmpty() || $subscriber->getAttribute('topicId') !== $topicId) {\n            throw new Exception(Exception::SUBSCRIBER_NOT_FOUND);\n        }\n\n        $target = $authorization->skip(fn () => $dbForProject->getDocument('targets', $subscriber->getAttribute('targetId')));\n        $user = $authorization->skip(fn () => $dbForProject->getDocument('users', $target->getAttribute('userId')));\n\n        $subscriber\n            ->setAttribute('target', $target)\n            ->setAttribute('userName', $user->getAttribute('name'));\n\n        $response\n            ->dynamic($subscriber, Response::MODEL_SUBSCRIBER);\n    }\n}\n","sourceCodeStart":48,"sourceCodeEnd":80,"githubUrl":"https://github.com/appwrite/appwrite/blob/ca3c55abfe2c8014937fdf778716af4524f2fcfc/src/Appwrite/Platform/Modules/Messaging/Http/Topics/Subscribers/Get.php#L48-L80","documentation":"Thrown when the subscriber document does not exist or its topicId attribute does not match the path's topicId. Matching the subscriber to the topic prevents cross-topic subscriber ID leakage. Note it fires only after the topic itself was found.","triggerScenarios":"GET /messaging/topics/{topicId}/subscribers/{subscriberId} where the subscriber was deleted, the ID is wrong, or the subscriber belongs to a different topic.","commonSituations":"Using a subscriber ID stored from another topic; listing via a stale cursor then fetching a since-deleted subscriber; typo in subscriberId.","solutions":["Fetch the subscriber through the topic it belongs to: GET /messaging/topics/{correctTopicId}/subscribers/{subscriberId}.","List the topic's subscribers (GET /messaging/topics/{topicId}/subscribers) to confirm the ID.","Handle 404 gracefully in the client — subscribers can be deleted at any time by users or token expiry flows."],"exampleFix":"// before\n$s = $messaging->getSubscriber($topicAId, $subscriberId); // subscriber is in topic B\n// after\n$s = $messaging->getSubscriber($topicBId, $subscriberId);","handlingStrategy":"try-catch","validationCode":"$sub = $messaging->getSubscriber($topicId, $subscriberId); // 404 if not in this topic","typeGuard":null,"tryCatchPattern":"try {\n    $s = $messaging->getSubscriber($topicId, $subscriberId);\n} catch (AppwriteException $e) {\n    if ($e->getCode() === 404) { /* subscriber absent or in another topic */ }\n    else throw $e;\n}","preventionTips":["Store the owning topicId with every subscriber reference","Refresh UI lists instead of deep-linking to possibly deleted subscribers","Never reuse subscriber IDs across topics"],"tags":["messaging","subscriber","not-found"],"backgroundTag":"record-not-found","analyzedSha":"ca3c55abfe2c8014937fdf778716af4524f2fcfc","analyzedAt":"2026-09-16T21:43:23.363Z","contentChangedAt":"2026-09-16T21:43:23.363Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}