{"record":{"id":"7c6d321ba8372558","repo":"we-promise/sure","slug":"record-not-found-7c6d32","errorCode":"record_not_found","errorMessage":"The requested resource was not found","messagePattern":"The requested resource was not found","errorType":"http","errorClass":"ActiveRecord::RecordNotFound","httpStatus":404,"severity":"error","filePath":"app/controllers/api/v1/rejected_transfers_controller.rb","lineNumber":32,"sourceCode":"    @pagy, @rejected_transfers = pagy(\n      rejected_transfers_query,\n      page: safe_page_param,\n      limit: @per_page\n    )\n\n    render :index\n  rescue Api::V1::TransferDecisionFiltering::InvalidFilterError => e\n    render_validation_error(e.message)\n  end\n\n  def show\n    render :show\n  end\n\n  private\n\n    def set_rejected_transfer\n      raise ActiveRecord::RecordNotFound unless valid_uuid?(params[:id])\n\n      @rejected_transfer = rejected_transfers_scope.find(params[:id])\n    end\n\n    def rejected_transfers_scope\n      transfer_decision_scope(RejectedTransfer)\n    end\nend\n","sourceCodeStart":14,"sourceCodeEnd":41,"githubUrl":"https://github.com/we-promise/sure/blob/e69894adb92547273377398c15f45c979cd9416a/app/controllers/api/v1/rejected_transfers_controller.rb#L14-L41","documentation":"Raised by set_rejected_transfer in Api::V1::RejectedTransfersController (app/controllers/api/v1/rejected_transfers_controller.rb:32). The valid_uuid? guard rejects malformed ids up front; otherwise rejected_transfers_scope (transfer_decision_scope(RejectedTransfer)) must contain the row, which filters rejected transfers by the token owner's family and the transfer-decision filters. Missing either way, ActiveRecord::RecordNotFound becomes a 404 record_not_found.","triggerScenarios":"GET /api/v1/rejected_transfers/:id with a non-UUID id; a rejected transfer belonging to another family; a transfer id that exists but is not a RejectedTransfer (e.g. an accepted Transfer id).","commonSituations":"Client reuses an id from the /transfers collection against /rejected_transfers; multi-family API key confusion; record permanently resolved/removed.","solutions":["List candidates with GET /api/v1/rejected_transfers and use an id from that collection only","Do not mix ids between /transfers and /rejected_transfers","Validate the id is a UUID before requesting","Handle 404 as 'already handled/gone' rather than retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"UUID_RE = /\\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\z/i\nUUID_RE.match?(id) or raise ArgumentError, 'id must be a UUID'","typeGuard":null,"tryCatchPattern":"begin\n  client.get(\"/api/v1/rejected_transfers/#{id}\")\nrescue Faraday::ResourceNotFound\n  # 404: not a rejected transfer in this family's decision scope\nend","preventionTips":["Source ids only from GET /api/v1/rejected_transfers","Never reuse ids between /transfers and /rejected_transfers","Treat 404 as resolved/gone"],"tags":["rails","activerecord","record-not-found","http-404","uuid","api"],"backgroundTag":"record-not-found","analyzedSha":"e69894adb92547273377398c15f45c979cd9416a","analyzedAt":"2026-08-21T18:22:41.165Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}