{"record":{"id":"467b861a9c08b5b0","repo":"transloadit/uppy","slug":"call-to-thumbnail-is-not-implemented-467b86","errorCode":null,"errorMessage":"call to thumbnail is not implemented","messagePattern":"call to thumbnail is not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/@uppy/companion/src/server/provider/onedrive/index.ts","lineNumber":132,"sourceCode":"          `${getRootPath(queryRecord)}/items/${id}/content`,\n          { responseType: 'json' },\n        )\n        const { size } = await prepareStream(stream)\n        return { stream, size }\n      },\n    )\n  }\n\n  override async thumbnail(): Promise<{\n    stream: Readable\n    contentType: string\n  }> {\n    // not implementing this because a public thumbnail from onedrive will be used instead\n    logger.error(\n      'call to thumbnail is not implemented',\n      'provider.onedrive.thumbnail.error',\n    )\n    throw new Error('call to thumbnail is not implemented')\n  }\n\n  override async size({\n    id,\n    query,\n    providerUserSession: { accessToken: token },\n  }: {\n    id: string\n    query: Query\n    providerUserSession: OneDriveUserSession\n  }): Promise<number | undefined> {\n    return this.#withErrorHandling('provider.onedrive.size.error', async () => {\n      const queryRecord = getQueryRecord(query)\n      const body = await getClient({ token })\n        .get(`${getRootPath(queryRecord)}/items/${id}`, {\n          responseType: 'json',\n        })\n        .json<Record<string, unknown>>()","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/companion/src/server/provider/onedrive/index.ts#L114-L150","documentation":"OneDrive's Companion provider deliberately does not implement thumbnail(): OneDrive/SharePoint expose public thumbnail URLs via the drives/items/{id}/thumbnails API, so proxying image bytes through Companion is unnecessary. Calling thumbnail() throws immediately after logging 'provider.onedrive.thumbnail.error'.","triggerScenarios":"Invoking the generic thumbnail route or provider.thumbnail() while the provider is 'onedrive'; generic code that assumes every provider implements the full Provider interface.","commonSituations":"Building provider-agnostic thumbnail logic; migrating from a provider that implements thumbnail (e.g. Google Drive) and reusing the same call for OneDrive; UI not consuming the thumbnail links already present in list() output.","solutions":["Use the thumbnail URLs already returned by OneDrive's list() results instead of calling thumbnail()","Gate thumbnail() calls on provider capability","Catch this error and fall back to the item's public thumbnail link"],"exampleFix":"// before\nconst { stream } = await provider.thumbnail({ id, providerUserSession })\n\n// after\nif (provider.id === 'onedrive') {\n  return item.thumbnail // public URL from list()\n}\nconst { stream } = await provider.thumbnail({ id, providerUserSession })","handlingStrategy":"validation","validationCode":"const THUMBNAILLESS_PROVIDERS = new Set(['onedrive', 'facebook'])\nif (!THUMBNAILLESS_PROVIDERS.has(providerId)) {\n  const { stream } = await provider.thumbnail({ id, providerUserSession })\n}","typeGuard":"const supportsThumbnail = (p: { id: string }): boolean => p.id !== 'onedrive' && p.id !== 'facebook'","tryCatchPattern":"try { await provider.thumbnail(args) } catch (e) { if (e instanceof Error && e.message === 'call to thumbnail is not implemented') { return item.thumbnail } throw e }","preventionTips":["Use OneDrive's public thumbnail URLs from list() output","Gate optional provider methods behind capability checks"],"tags":["onedrive","thumbnail","not-implemented","companion","provider"],"backgroundTag":"method-not-implemented","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}