Ghost/ghost/admin/app/services
Chris Raible 046b06fe72
Refactored local revisions to avoid QuotaExceededErrors (#21128)
ref https://ghost-foundation.sentry.io/issues/5908152800/

- In the current state, we are maintaining an 'index' key for all
revisions in localStorage. This gives us quick and easy access to all
the revisions in localStorage, but it requires additional "bookkeeping"
to update the index each time we add/remove a key.
- In some obscure edge cases, this results in the `remove()` method
throwing a `QuotaExceededError` (since removing a revision also requires
updating the index with `localStorage.setItem()`). If the `remove()`
call fails, we are sort of stuck — the only way to reduce our storage
usage is to remove items, but if the `remove()` method throws errors, we
can't do that.
- This change removes the whole index concept, and instead loops over
all the keys in localStorage, filtering by the prefix to find all our
revisions. This makes the `keys()` method slightly more complex, as it
has to filter out keys in localStorage that aren't related to revisions,
but it simplifies saving and removing revisions.
- Critically, this also means that `remove()` should never throw a
`QuotaExceededError`, since it no longer needs to call
`localStorage.setItem()` — it now simply calls
`localStorage.removeItem()` for the revision, which should never fail.
2024-09-26 12:50:31 -07:00
..
ajax.js Fixed Sentry ajax error tags (#19034) 2023-11-16 12:27:07 -08:00
billing.js Updated <GHBillingIframe> to not leak event listeners 2022-11-07 11:59:14 +00:00
clock.js Dropped ember-cli-moment-shim dependency 2022-09-24 13:28:23 +02:00
config-manager.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
custom-theme-settings.js 🐛 Fixed issue with settings being marked as dirty when visibility is changed (#18370) 2023-09-27 08:18:21 +01:00
custom-views.js Removed need for .get() with settings service 2022-10-07 16:14:57 +01:00
dashboard-mocks.js Refined attribution source modal on dashboard 2022-10-07 15:43:59 +05:30
dashboard-stats.js Optimized aggregating member attribution statistics 2024-07-02 11:44:22 +02:00
data-cache.js Added data-cache service for managing limited-lifetime cached data 2022-01-21 18:15:06 +00:00
dropdown.js Added support for selecting posts 2023-04-05 18:00:08 +02:00
event-bus.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
explore.js Fixed ForceUpgrade state not working with Explore 2023-09-25 12:56:04 +01:00
feature.js Added comment improvements feature flag (#20986) 2024-09-12 14:49:22 +09:00
frontend.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
ghost-paths.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
koenig.js Added pre-emptive fetch of editor module after logging in to Admin 2023-10-04 17:45:42 +01:00
lazy-loader.js Fixed loading CDN assets via lazy loading 2023-07-17 14:03:20 +02:00
limit.js Reduced amount of member count queries when opening the editor (#19474) 2024-01-13 19:13:49 +01:00
local-revisions.js Refactored local revisions to avoid QuotaExceededErrors (#21128) 2024-09-26 12:50:31 -07:00
media-queries.js [chore] Ran native classes codemod for app/services (#2240) 2022-02-02 22:11:11 +00:00
member-import-validator.js Added import tier to members import modal (#17492) 2023-07-26 09:19:09 +01:00
members-count-cache.js Improved API speed of members count cache queries (#19475) 2024-01-13 19:12:16 +01:00
members-stats.js Removed duplicate member count queries in admin (#19473) 2024-01-13 18:40:28 +01:00
members-utils.js Added basic UI to update portal signup term settings 2023-04-04 10:10:06 +02:00
mention-utils.js Fixed broken empty state in mentions admin url (#16419) 2023-03-16 21:19:56 +05:30
migrate.js Send Ghost version to migrator tool (#19494) 2024-01-16 13:10:39 +00:00
modals.js 🐛 Fixed closing modals in admin UI when releasing mouse outside modal 2023-06-08 13:50:44 +02:00
navigation.js Removed need for .get() with settings service 2022-10-07 16:14:57 +01:00
notifications.js Handled unhandled ember ajax errors (#18803) 2023-10-31 13:56:34 +00:00
onboarding.js Cleaned up onboardingChecklist GA labs flag 2024-06-20 11:42:42 +01:00
resize-detector.js Migrated <GhUnsplash> to glimmer component 2022-02-07 16:53:12 +00:00
search-provider-basic.js Cleaned up internalLinking labs flag 2024-08-12 13:08:29 +01:00
search-provider-flex.js Cleaned up internalLinking labs flag 2024-08-12 13:08:29 +01:00
search.js Cleaned up internalLinking labs flag 2024-08-12 13:08:29 +01:00
session.js Added PostHog identify calls in admin using hashed email address of user (#19685) 2024-02-13 13:23:03 -08:00
settings.js Added recommendations as suggestions to the Button, Header, Email CTA cards (#18293) 2023-09-22 09:58:44 +00:00
slug-generator.js 🐛 Fixed pasting newlines in post titles (#15794) 2022-11-10 14:43:15 +01:00
tenor.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
theme-management.js Hide preview select for design/announcement settings (#16721) 2023-05-01 18:50:13 +04:00
ui.js Updated Admin meta title to Ghost Admin – [site title] (#19023) 2023-11-16 13:15:48 +01:00
unsplash.js Fixed hosting management screen not loading after sign-in process (#15763) 2022-11-03 11:14:36 +00:00
upgrade-status.js Wired up click-to-refresh upgrade banner 2023-03-02 18:39:38 +00:00
utils.js Added fetchAndDownloadFile method to utils service 2023-04-07 14:44:28 +07:00
whats-new.js What's new popup (#20112) 2024-05-21 12:36:28 +02:00