#diagnostics 16 articles
"File is missing" and "I cannot read the file" collapse into the same null — and the empty state then lies gotchas / rest-api A T | null helper folds 404, 403, 500 and network failure into one null, and the friendly empty state then lies to the one user who has overdue work; return {ok, status, data} and let only 404 (on every candidate path)… "Invalid text value" (HTTP 500) means a Text column hit its 255-character limit gotchas / rest-api Generic 500 naming no field; a Text column capped at 255 /_api/HubSites returns an empty list (HTTP 200) when the caller cannot see the hub sites gotchas / rest-api The hub list is security-trimmed, so an account that cannot read the hub sites gets value: [] with HTTP 200; "this site has no hub" and "no inherited owner" must never be derived from it — read IsHubSite/HubSiteId from… A "grant it for me" button cannot work in a web part — not even for a Global Administrator gotchas / spfx A delegated call gets the intersection of the user's rights and the app's grants, so the admin at the keyboard adds nothing; writing the grant would take at least DelegatedPermissionGrant.ReadWrite.All approved for the… A deleted site and a site you cannot see are two different answers — read the status, not ok gotchas / rest-api _api/web on a non-existent site collection answers 404 (measured, no redirect), so if (!r.ok) return unknown makes a dead row in your own site inventory look like a site you merely lack permission on; keep r.status… A field you write is never read back — $select is an allowlist and a ?? fallback hides the gap gotchas / rest-api $select is an allowlist; a snapshot ?? live fallback silently erases the feature the snapshot exists for A mail-permission probe that can't tell "no mailbox" from "no consent" lies to admins gotchas / graph /me/messages 404 MailboxNotEnabled* on mailbox-less accounts ≠ missing consent; three verdicts, and never cache a negative probe result Azure OpenAI 429 on a single request is a TPM ceiling, not a busy service — measure size, not frequency gotchas / azure-functions One request whose prompt exceeds the deployment's TPM allowance can never fit the window, so retrying is futile — a sub-second rejection means "over the ceiling", not "busy"; separate the two with a small/large request… File versions come back oldest-first, so $top truncates the newest ones gotchas / rest-api /Versions is ascending, so $top drops the NEWEST ones; sorting the result descending afterwards hides it; $orderby=ID desc IS honoured together with $top (measured), and the list never contains the current version getUserEffectivePermissions returns a 64-bit mask — decode it wrong by one bit and every user looks locked out gotchas / security ViewListItems is bit 0, Low/High are decimal strings; decode off by one and every ordinary member looks locked out. Sanity-check the decoder against a site admin AND a known Read user List item versions come back newest-first and include the current one – the opposite of file versions gotchas / rest-api items(id)/versions is DESCENDING and its first row is the current version (IsCurrentVersion: true) – the opposite of file /Versions; Created on a version is UTC WITHOUT the Z, so new Date() shifts it by the browser… Search ignores unknown managed properties — silently gotchas / search A made-up property name returns HTTP 200 with full results; auto-created Choice properties are not queryable; probe with a fake name, map to RefinableString SharePoint's built-in PDF conversion endpoint works only with a plain fetch — auth headers break the redirect gotchas / rest-api _api/v2.0/drives/…/content?format=pdf converts Office files server-side with no Graph consent, but auth-decorating clients break its 302 to *.svc.ms; resolve the drive explicitly and guard on Content-Type The crawl log DOES exist in SharePoint Online — it just isn't where you look for it gotchas / search Reachable only through CSOM DocumentCrawlLog via /_vti_bin/client.svc/ProcessQuery, gated by a separate Crawl Log Permissions grant that no admin role implies; returns ~52 columns incl. per-pass crawl timestamps… Two "Uncaught (in promise)" from sp-pages-assembly on a modern page are SharePoint's own, not your web part gotchas / spfx On SharePoint Online modern pages the console can show two "Uncaught (in promise)" exceptions with reason undefined and a stack only inside sp-pages-assembly, on every load and on SPA navigation – they also appear on a… Web part properties are missing from CanvasContent1 on single-part app pages gotchas / rest-api Single-part app pages store web part config elsewhere; do not diagnose "not set" from page fields — but the web part id IS there, so use it to find the hosting page (not ClientSideApplicationId)