You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The status endpoint is a quick "health-check" endpoint that doesn't get functionally used by the site, but is purely for monitoring purposes. It is a quick way to view and discrepancies between Contentful data and the Algolia index.
There appears to be a handful of keys right now that are creating false mismatches between Contentful and Algolia, either due to some edge cases in null values not being caught properly, or quirks of what does or doesn't get shown as changed when the Contentful webhook gets fired that our update Algolia endpoint is the recipient of.
Technical causes
Reason why the children key mismatch keeps happening:
children gets calculated in loadPageMetadataMap, which only gets the latest value when initially adding a new page to the map. When a page removes or changes its parent, that only triggers an update in the algolia index for that page, not the parent whose children are changing.
Solution 1: remove children from the Algolia records entirely
Solution 2: when updating the parent for a record, also do the following:
If new parent value is null, then simply remove the current page from the old parent page's children array
If the new parent value is not null, remove the current page from the old parent and add it to the new parent's children array
Solution 2 is more effort and doesn't gain us anything at this time. Therefore, it probably makes sense to just quickly do solution 1 as a one-off solution.
Reason why the metaTitle and metaDescription mismatch keeps happening (I think):
The contentful webhook only includes defined values in updates it pushes out. Therefore, if a value is removed, it doesn't get included in the payload.
When comparison then happens in the SvelteKit API endpoint, it gets skipped entirely
Solution: make sure we explicitly check for those fields, as we should always be expecting them
Add-on to that solution: also include a "reset" endpoint for individual records, and not just a wholesale reset
Alternatively, make a reset endpoint that accepts an array of recordIds and resets all of those (i.e., this is the middle ground between a wholesale reset and an endpoint that can only reset individual records)
More recent issues
internalRedirect and externalRedirect appear to suffer from a similar null value issue, but the cause still needs to get diagnosed.
The text was updated successfully, but these errors were encountered:
The Problem
The status endpoint is a quick "health-check" endpoint that doesn't get functionally used by the site, but is purely for monitoring purposes. It is a quick way to view and discrepancies between Contentful data and the Algolia index.
There appears to be a handful of keys right now that are creating false mismatches between Contentful and Algolia, either due to some edge cases in null values not being caught properly, or quirks of what does or doesn't get shown as changed when the Contentful webhook gets fired that our update Algolia endpoint is the recipient of.
Technical causes
Reason why the
children
key mismatch keeps happening:children
gets calculated inloadPageMetadataMap
, which only gets the latest value when initially adding a new page to the map. When a page removes or changes its parent, that only triggers an update in the algolia index for that page, not the parent whose children are changing.children
from the Algolia records entirelynull
, then simply remove the current page from the old parent page'schildren
arraynull
, remove the current page from the old parent and add it to the new parent'schildren
arrayReason why the
metaTitle
andmetaDescription
mismatch keeps happening (I think):recordIds
and resets all of those (i.e., this is the middle ground between a wholesale reset and an endpoint that can only reset individual records)More recent issues
internalRedirect
andexternalRedirect
appear to suffer from a similarnull
value issue, but the cause still needs to get diagnosed.The text was updated successfully, but these errors were encountered: