[GIT] Evergreen ILS branch main updated. 04edf032309e454d191183a49f7b9f1502be6de0

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via 04edf032309e454d191183a49f7b9f1502be6de0 (commit) via deb02bb9d813c4c220712a8ffd1ab5c6867c7197 (commit) via 667c5b89d7e9001b3c4c9a14319416c9df021acc (commit) via f05a370e05fbf8209a0d4ed5b967bb890d70777c (commit) via 8ee457a4a04b8cf5557d8587075014ea11b71e1c (commit) from 7ddcbb35f0f373ad161282b40252e68f6b1ed046 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 04edf032309e454d191183a49f7b9f1502be6de0 Author: Jane Sandberg <sandbergja@gmail.com> Date: Mon Mar 17 19:41:30 2025 -0700 LP2084181: stamp upgrade script Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 121d2e257b..3eb6bf8f11 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps BEFORE INSERT OR UPDATE ON config.db_patch_dependencies FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates'); -INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1459', :eg_version); -- terranm/blake +INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1460', :eg_version); -- JBoyer/sandbergja CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql b/Open-ILS/src/sql/Pg/upgrade/1460.data.staff_client_clear_long_caches.sql similarity index 88% rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql rename to Open-ILS/src/sql/Pg/upgrade/1460.data.staff_client_clear_long_caches.sql index dbbadadc08..28e5d37a0c 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql +++ b/Open-ILS/src/sql/Pg/upgrade/1460.data.staff_client_clear_long_caches.sql @@ -1,6 +1,6 @@ BEGIN; ---SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); -- JBoyer +SELECT evergreen.upgrade_deps_block_check('1460', :eg_version); -- JBoyer -- Note: the value will not be consistent from system to system. It's an opaque key that has no meaning of its own, -- if the value cached in the client does not match or is missing, it clears some cached values and then saves the current value. commit deb02bb9d813c4c220712a8ffd1ab5c6867c7197 Author: Jane Sandberg <sandbergja@gmail.com> Date: Mon Mar 17 19:38:40 2025 -0700 LP2084181: two small follow-ups * toPromise() is deprecated, this commit instead uses lastValueFrom so there is one less thing to clean up. * remove a redundant Promise.resolve() Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/eg2/src/app/core/auth.service.ts b/Open-ILS/src/eg2/src/app/core/auth.service.ts index 1f5ba13151..787afcee44 100644 --- a/Open-ILS/src/eg2/src/app/core/auth.service.ts +++ b/Open-ILS/src/eg2/src/app/core/auth.service.ts @@ -4,6 +4,7 @@ import {NetService} from './net.service'; import {EventService, EgEvent} from './event.service'; import {IdlService, IdlObject} from './idl.service'; import {StoreService} from './store.service'; +import { lastValueFrom } from 'rxjs'; // Not universally available. declare var BroadcastChannel; // eslint-disable-line no-var @@ -255,10 +256,10 @@ export class AuthService { } - return this.net.request( + return lastValueFrom(this.net.request( 'open-ils.actor', 'open-ils.actor.staff_client_cache_key' - ).toPromise().then(cacheKey => { + )).then(cacheKey => { console.debug('Cache key: ' + cacheKey); const currentKey = this.store.getLocalItem('eg.staff_client_cache_key'); @@ -280,8 +281,6 @@ export class AuthService { this.store.removeLocalItems(clearItems); this.store.setLocalItem('eg.staff_client_cache_key', cacheKey); } - - return Promise.resolve(); }); } commit 667c5b89d7e9001b3c4c9a14319416c9df021acc Author: Jason Boyer <> Date: Tue Nov 19 16:23:04 2024 -0500 LP2084181: Add Release Note Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/docs/RELEASE_NOTES_NEXT/Administration/staff_client_cache_clear.adoc b/docs/RELEASE_NOTES_NEXT/Administration/staff_client_cache_clear.adoc new file mode 100644 index 0000000000..78be623e51 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Administration/staff_client_cache_clear.adoc @@ -0,0 +1,9 @@ +== Global Long-Lived Cache Clearing for Staff Client == + +A new global flag (staff.client_cache_key) has been added that allows +administrators to clear certain long-lived cache values from all staff clients +at next login by simply changing the value. Currently only the MARC Tag Tables +used by the bibliographic and authority record editors are cleared, but the +list of localStorage items cleared may be expanded in future. This key is +simply an opaque string - no special format is required - changing the value in +any way will trigger a wave of cache clearing. commit f05a370e05fbf8209a0d4ed5b967bb890d70777c Author: Jason Boyer <> Date: Mon Nov 18 15:23:48 2024 -0500 LP2084181: Long-Lived-Cache Clearing for Staff Client Add a global flag and method to retrieve it for the staff client. If this value hasn't been set before or doesn't match the value in localStorage, clear some long-lived cache values from the staff client. Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/eg2/src/app/core/auth.service.ts b/Open-ILS/src/eg2/src/app/core/auth.service.ts index fc4100d666..1f5ba13151 100644 --- a/Open-ILS/src/eg2/src/app/core/auth.service.ts +++ b/Open-ILS/src/eg2/src/app/core/auth.service.ts @@ -254,7 +254,36 @@ export class AuthService { this.store.setLoginSessionItem(`${this.authDomain}.time`, this.authtime()); } - return Promise.resolve(); + + return this.net.request( + 'open-ils.actor', + 'open-ils.actor.staff_client_cache_key' + ).toPromise().then(cacheKey => { + console.debug('Cache key: ' + cacheKey); + + const currentKey = this.store.getLocalItem('eg.staff_client_cache_key'); + + if ( currentKey !== cacheKey ) { + const allItems = this.store.getLocalItemNames(); + const clearItems = []; + + allItems.forEach(aryItem => { + // MARC Tag Tables take a long time to load + if (aryItem.match(/^ff/i)) { clearItems.push(aryItem); } + if (aryItem.match('^current_tag_table')) { clearItems.push(aryItem); } + // Additional RE matches against aryItem can be added here + }); + // Additional static keys can be added here + // clearItems.push('eg.some.key.whatevs'); + + console.debug('Cache key changed, clearing localStorage items: ' + clearItems.join(', ')); + this.store.removeLocalItems(clearItems); + this.store.setLocalItem('eg.staff_client_cache_key', cacheKey); + } + + return Promise.resolve(); + }); + } undoOpChange(): Promise<any> { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm index 027b9025d4..6d724695dc 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm @@ -5403,4 +5403,31 @@ sub filter_group_entry_crud { } } +__PACKAGE__->register_method( + method => "get_staff_client_cache_key", + api_name => "open-ils.actor.staff_client_cache_key", + signature => { + desc => q/ + Return a key that the staff client can use to + determine whether it should purge long-cached objects + /, + return => { + desc => "An opaque cache key", + type => "string" + } + } +); + +sub get_staff_client_cache_key { + my $self = shift; + + my $value = $U->get_global_flag('staff.client_cache_key'); + + $value = $value->value() if $value; + # Undef is an unfriendly "not found" + $value = "BleepBloopNoKey" unless $value; + + return $value; +} + 1; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 52ed1f9a44..411ebbdaf3 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -12862,6 +12862,19 @@ INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( TRUE ); +INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( + 'staff.client_cache_key', + oils_i18n_gettext( + 'staff.client_cache_key', + 'Change this value to force staff clients to clear some cached values', + 'cgf', + 'label' + ), + md5(random()::text), + TRUE +); + + INSERT INTO config.usr_setting_type (name,opac_visible,label,description,datatype) VALUES ( 'history.circ.retention_age', diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql new file mode 100644 index 0000000000..dbbadadc08 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.staff_client_clear_long_caches.sql @@ -0,0 +1,19 @@ +BEGIN; + +--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); -- JBoyer + +-- Note: the value will not be consistent from system to system. It's an opaque key that has no meaning of its own, +-- if the value cached in the client does not match or is missing, it clears some cached values and then saves the current value. +INSERT INTO config.global_flag (name, label, value, enabled) VALUES ( + 'staff.client_cache_key', + oils_i18n_gettext( + 'staff.client_cache_key', + 'Change this value to force staff clients to clear some cached values', + 'cgf', + 'label' + ), + md5(random()::text), + TRUE +); + +COMMIT; commit 8ee457a4a04b8cf5557d8587075014ea11b71e1c Author: Jason Boyer <> Date: Tue Nov 12 19:37:46 2024 +0000 LP2084181: Add StoreService calls for multiple items Add some convenience calls that take array parameters to the StoreService for localStorage items. Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org> Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/eg2/src/app/core/store.service.ts b/Open-ILS/src/eg2/src/app/core/store.service.ts index d55cdc0603..e18ececc1c 100644 --- a/Open-ILS/src/eg2/src/app/core/store.service.ts +++ b/Open-ILS/src/eg2/src/app/core/store.service.ts @@ -113,6 +113,14 @@ export class StoreService { return this.parseJson(window.localStorage.getItem(key)); } + getLocalItemNames(): string[] { + const keys = []; + for (let i = 0; i < window.localStorage.length ; i++ ) { + keys.push(window.localStorage.key(i)); + } + return keys; + } + getSessionItem(key: string): any { return this.parseJson(window.sessionStorage.getItem(key)); } @@ -198,6 +206,10 @@ export class StoreService { window.localStorage.removeItem(key); } + removeLocalItems(keys: string[]): void { + keys.forEach((key) => this.removeLocalItem(key)); + } + removeSessionItem(key: string): void { window.sessionStorage.removeItem(key); } ----------------------------------------------------------------------- Summary of changes: Open-ILS/src/eg2/src/app/core/auth.service.ts | 30 +++++++++++++++++++++- Open-ILS/src/eg2/src/app/core/store.service.ts | 12 +++++++++ .../src/perlmods/lib/OpenILS/Application/Actor.pm | 27 +++++++++++++++++++ Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 13 ++++++++++ .../1460.data.staff_client_clear_long_caches.sql | 19 ++++++++++++++ .../Administration/staff_client_cache_clear.adoc | 9 +++++++ 7 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/1460.data.staff_client_clear_long_caches.sql create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/staff_client_cache_clear.adoc hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User