Skip to content

Render users bookmarks in sidebar#1330

Closed
jcscottiii wants to merge 3 commits intomainfrom
jcscottiii/ui-searches-v4.8.4
Closed

Render users bookmarks in sidebar#1330
jcscottiii wants to merge 3 commits intomainfrom
jcscottiii/ui-searches-v4.8.4

Conversation

@jcscottiii
Copy link
Collaborator

@jcscottiii jcscottiii commented Mar 26, 2025

This change adds a new subsection to the sidebar that renders their bookmarks

Added a new playwright screenshot for authenticated users

Other changes:

  • Modify the firebase auth user context to have a null state. We need to be able to determine three states: Verified that the user is authenticated, Verified that the user is unauthenticated, and in progress. The null state takes care of the second case.
  • Moved login logic for playwright test to reusable helper
  • Address edge case for firefox when counting requests in playwright tests.

image

@jcscottiii jcscottiii force-pushed the jcscottiii/ui-searches-v4.8.4 branch from 2af9039 to fa40d20 Compare March 26, 2025 22:13
@jcscottiii jcscottiii force-pushed the jcscottiii/ui-searches-v4.8.3 branch 2 times, most recently from 45db461 to 6353021 Compare March 26, 2025 23:48
Base automatically changed from jcscottiii/ui-searches-v4.8.3 to main March 27, 2025 00:21
@jcscottiii jcscottiii force-pushed the jcscottiii/ui-searches-v4.8.4 branch 2 times, most recently from 139c91a to 99fc73c Compare March 27, 2025 21:45
This change adds a new subsection to the sidebar that renders their bookmarks

Added a new playwright screenshot for authenticated users

Other changes:
- Modify the firebase auth user context to have a null state. We need to be able to determine three states: Verified that the user is authenticated, Verified that the user is unauthenticated, and in progress. The null state takes care of the second case.
- Moved login logic for playwright test to reusable helper
- Address edge case for firefox when counting requests in playwright tests.
@jcscottiii jcscottiii force-pushed the jcscottiii/ui-searches-v4.8.4 branch from 99fc73c to ff06ce4 Compare March 27, 2025 21:47
jcscottiii added a commit that referenced this pull request Mar 29, 2025
Background:

This PR refactors data fetching in two components by turning autoRun to false.
I originally observed an issue in Firefox in my original PR (#1330).
The firefox browser was seeing the tasks trigger multiple times and I thought my current handling of TaskNotReadyError and DuplicateErrors/TaskNotReadyError would handle it.
However, in lit task if a task triggers while there's a pending task already running, it would abort the first task. So as a result, sometimes firefox would
not get any information if the original task was aborted and the subsequent tasks were returning one of the DuplicateTaskErrors/TaskNotReadyError causing no more task executions to fully succeed.

This tries to simplify things by turning off autoRun and leveraging the willUpdate lit lifecycle method to precisely run a task. This allows us to not have to do checks on the task's arguments within the task itself since we control when the task exactly triggers.

Main changes:
- **`OverviewPage`:** The `loadingTask` is no longer set to `autoRun: true`. Instead, it is manually triggered in `willUpdate` based on changes to relevant properties and bookmark loading status. The `TaskNotReadyError` and related logic have been removed.
- **`webstatus-bookmarks-service`:**
    - The `loadingUserSavedBookmarkByIDTask` is no longer set to `autoRun: true` and is triggered in `willUpdate`.
    - The task now returns an object containing both the bookmark data and the current search query.

Other changes:
- **`webstatus-firebase-auth-service`:** Updated the type of the `user` state to `User | null | undefined`.
- Removed some redundant tests. Changed some tests to use sinon stubs
- Added some more coverage too.

This is a split up of #1330
@jcscottiii jcscottiii marked this pull request as draft March 29, 2025 20:07
@jcscottiii
Copy link
Collaborator Author

This has been split up into #1334, #1335, #1336

github-merge-queue bot pushed a commit that referenced this pull request Mar 31, 2025
Background:

This PR refactors data fetching in two components by turning autoRun to false.
I originally observed an issue in Firefox in my original PR (#1330).
The firefox browser was seeing the tasks trigger multiple times and I thought my current handling of TaskNotReadyError and DuplicateErrors/TaskNotReadyError would handle it.
However, in lit task if a task triggers while there's a pending task already running, it would abort the first task. So as a result, sometimes firefox would
not get any information if the original task was aborted and the subsequent tasks were returning one of the DuplicateTaskErrors/TaskNotReadyError causing no more task executions to fully succeed.

This tries to simplify things by turning off autoRun and leveraging the willUpdate lit lifecycle method to precisely run a task. This allows us to not have to do checks on the task's arguments within the task itself since we control when the task exactly triggers.

Main changes:
- **`OverviewPage`:** The `loadingTask` is no longer set to `autoRun: true`. Instead, it is manually triggered in `willUpdate` based on changes to relevant properties and bookmark loading status. The `TaskNotReadyError` and related logic have been removed.
- **`webstatus-bookmarks-service`:**
    - The `loadingUserSavedBookmarkByIDTask` is no longer set to `autoRun: true` and is triggered in `willUpdate`.
    - The task now returns an object containing both the bookmark data and the current search query.

Other changes:
- **`webstatus-firebase-auth-service`:** Updated the type of the `user` state to `User | null | undefined`.
- Removed some redundant tests. Changed some tests to use sinon stubs
- Added some more coverage too.

This is a split up of #1330
@jcscottiii jcscottiii closed this Mar 31, 2025
@jcscottiii jcscottiii deleted the jcscottiii/ui-searches-v4.8.4 branch May 13, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant