Skip to content

Fix filter cache breaking interface#1395

Closed
lkiesow wants to merge 1 commit into
opencast:r/18.xfrom
lkiesow:textfilter-breaks-ui
Closed

Fix filter cache breaking interface#1395
lkiesow wants to merge 1 commit into
opencast:r/18.xfrom
lkiesow:textfilter-breaks-ui

Conversation

@lkiesow
Copy link
Copy Markdown
Member

@lkiesow lkiesow commented Aug 5, 2025

Investigating people complaining develop.opencast.org being broken, it seems like there was a change to the filters which cannot handle the previous data which might still be stored in browsers. Like here means, it completely crashes the interface and users just see a blank page.

The error they get is:

Uncaught TypeError: t.find is not a function
    fk tableFilterSelectors.ts:23
    D reselect.mjs:647
    i reselect.mjs:584
    P reselect.mjs:659
    i reselect.mjs:584
    u TableFilters.tsx:55
    <anonymous> Redux
    L use-sync-external-store-with-selector.production.js:40
    h use-sync-external-store-with-selector.production.js:63
    React 2
    useSyncExternalStoreWithSelector use-sync-external-store-with-selector.production.js:74
    n Redux
    qc TableFilters.tsx:55
    React 14
    K scheduler.production.js:152
tableFilterSelectors.ts:23:32

This patch makes the code a bit more resilient so it can deal with the previous content.

EDIT: Rebased to r/18.x since the problem also appears there.

@lkiesow lkiesow added the type:bug Something isn't working label Aug 5, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 5, 2025

Use docker or podman to test this pull request locally.

Run test server using develop.opencast.org as backend:

podman run --rm -it -p 127.0.0.1:3000:3000 ghcr.io/opencast/opencast-admin-interface:pr-1395

Specify a different backend like stable.opencast.org:

podman run --rm -it -p 127.0.0.1:3000:3000 -e PROXY_TARGET=https://stable.opencast.org ghcr.io/opencast/opencast-admin-interface:pr-1395

It may take a few seconds for the interface to spin up.
It will then be available at http://127.0.0.1:3000.
For more options you can pass on to the proxy, take a look at the README.md.

@lkiesow lkiesow force-pushed the textfilter-breaks-ui branch from 22034df to a62bb91 Compare August 5, 2025 19:59
@lkiesow lkiesow changed the base branch from develop to r/18.x August 5, 2025 20:00
Investigating people complaining develop.opencast.org being broken, it
seems like there was a change to the filters which cannot handle the
previous data which might still be stored in browsers. Like here means,
it completely crashes the interface and users just see a blank page.

The error they get is:

```
Uncaught TypeError: t.find is not a function
    fk tableFilterSelectors.ts:23
    D reselect.mjs:647
    i reselect.mjs:584
    P reselect.mjs:659
    i reselect.mjs:584
    u TableFilters.tsx:55
    <anonymous> Redux
    L use-sync-external-store-with-selector.production.js:40
    h use-sync-external-store-with-selector.production.js:63
    React 2
    useSyncExternalStoreWithSelector use-sync-external-store-with-selector.production.js:74
    n Redux
    qc TableFilters.tsx:55
    React 14
    K scheduler.production.js:152
tableFilterSelectors.ts:23:32
```

This patch makes the code a bit more resilient so it can deal with the
previous content.
@lkiesow lkiesow force-pushed the textfilter-breaks-ui branch from a62bb91 to 07881ac Compare August 5, 2025 20:01
@Arnei
Copy link
Copy Markdown
Member

Arnei commented Aug 6, 2025

Addresses the same issue as #1381, albeit a bit differently.

I'd really rather not have to account for both the old and the new type everywhere in the code in case the type of a variable that is stored in local storage changes between versions. That sounds like a headache.

While this indeed allows the admin ui to load, the value in local storage for textFilter is still of the wrong type, no? And that could still cause the admin ui to break when other code than the selector is interacting with it, e.g. when fetching events or when trying to change the textFilter value?

@lkiesow
Copy link
Copy Markdown
Member Author

lkiesow commented Aug 28, 2025

I'd like to apply the “Be pragmatic” rule to #1381 or this pull request. I understand that it is annoying to deal with changed data structures in the browser's local storage, but the reality is that we have to if we don't want users to end up with a completely broken interface. I got contacted a bunch of times about develop.opencast.org being broken. Usually by technical people. They couldn't fix that locally (they didn't realize that they had to drop their in-browser storage) and just assumed Opencast was down.

I'm also fine with working out a more generic solution for this, like dropping the local storage automatically if users run into an exception. But we can't just reject valid solutions for the problem at hand just because there might be a better one. That's something for later. Opencast is kind of broken for users now.

Can we merge one patch and bring it in todays release?

lkiesow added a commit to lkiesow/opencast-admin-interface that referenced this pull request Aug 28, 2025
Investigating people complaining develop.opencast.org being broken, it
seems like there was a change to the filters which cannot handle the
previous data which might still be stored in browsers. Like here means,
it completely crashes the interface and users just see a blank page.

The error they get is:

```
Uncaught TypeError: t.find is not a function
    fk tableFilterSelectors.ts:23
    D reselect.mjs:647
    i reselect.mjs:584
    P reselect.mjs:659
    i reselect.mjs:584
    u TableFilters.tsx:55
    <anonymous> Redux
    L use-sync-external-store-with-selector.production.js:40
    h use-sync-external-store-with-selector.production.js:63
    React 2
    useSyncExternalStoreWithSelector use-sync-external-store-with-selector.production.js:74
    n Redux
    qc TableFilters.tsx:55
    React 14
    K scheduler.production.js:152
tableFilterSelectors.ts:23:32
```

This patch introduces a general validation for filters, resetting them
if they are corrupted in the sense that the data structure is not
correct.

This closes opencast#1381
This closes opencast#1395
lkiesow added a commit to lkiesow/opencast-admin-interface that referenced this pull request Aug 28, 2025
Investigating people complaining develop.opencast.org being broken, it
seems like there was a change to the filters which cannot handle the
previous data which might still be stored in browsers. Like here means,
it completely crashes the interface and users just see a blank page.

The error they get is:

```
Uncaught TypeError: t.find is not a function
    fk tableFilterSelectors.ts:23
    D reselect.mjs:647
    i reselect.mjs:584
    P reselect.mjs:659
    i reselect.mjs:584
    u TableFilters.tsx:55
    <anonymous> Redux
    L use-sync-external-store-with-selector.production.js:40
    h use-sync-external-store-with-selector.production.js:63
    React 2
    useSyncExternalStoreWithSelector use-sync-external-store-with-selector.production.js:74
    n Redux
    qc TableFilters.tsx:55
    React 14
    K scheduler.production.js:152
tableFilterSelectors.ts:23:32
```

This patch introduces a general validation for filters, resetting them
if they are corrupted in the sense that the data structure is not
correct.

This closes opencast#1381
This closes opencast#1395
@gregorydlogan
Copy link
Copy Markdown
Member

Superceded by #1418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants