Commit Graph

196 Commits

Author SHA1 Message Date
schroda
3dfb80a237 Fix image queue creation 2025-11-23 00:23:33 +01:00
schroda
fe4bfd922e Queue image requests per source
If http protocol is h2 or newer, allow:
 - 5 requests per source
 - unlimited local source requests
2025-11-23 00:08:23 +01:00
schroda
890b304b4a Ignore source/extension, tracker icon and thumbnails requests from image queue
The server is not requesting these images through an extension; thus, it is not a problem to send them directly to the server since there is no problem of getting the server "stuck" due to extension rate limits.
2025-11-22 23:50:05 +01:00
schroda
9ed05f3fc0 Cache images via service worker
Improves the image request logic by making it possible to check if an image is cached.
In case an image is cached, it does not need to be put into the image queue because it won't be sent to the server.
2025-11-22 23:50:03 +01:00
schroda
e5eda76ea7 Recreate ws client when receiving auth error message 2025-11-20 13:58:44 +01:00
schroda
cdab741ce5 Replace missed occurrences with koration 2025-11-09 01:13:31 +01:00
schroda
490ebb5bde Restart subscriptions after token refresh
In case the connection got lost and the client reconnected again, there is a possibility that the auth token is expired. This will lead to the subscription to fail due to being unauthorized.
This, however, does not close the connection and the heartbeat messages are still being sent and received.
Thus, after refreshing the token, the connection is still alive but not authorized, which is the same as not having the connection open.
2025-11-07 12:09:36 +01:00
schroda
284c194ac3 Add "reset" functions to clients 2025-11-07 01:28:56 +01:00
schroda
8ac93ff3ff Recreate graphql ws client only as last resort
Try to force a reconnection by terminating the client first.
2025-11-06 02:42:33 +01:00
schroda
1d639f45ca Restart graphql subscriptions after ws client recreation
Disposing the client does not restart active subscriptions.
2025-11-06 02:41:58 +01:00
schroda
71b70ab0da Ensure graphql ws client is terminated when recreating it 2025-11-06 02:39:02 +01:00
schroda
ed0d597185 Cleanup getting server base url 2025-10-19 20:23:03 +02:00
schroda
0ffb54e2cc Fix infinite loading
- Reset "requires auth" flag in session storage for reset on tab refresh
- Fix context los for resolving, rejecting queued request
- Process queued requests after successful login

Regression 6636cc66b1

fixes #1028
2025-10-15 22:50:27 +02:00
schroda
6636cc66b1 Prevent sending requests that are known to fail
In case it's still unknown if auth is set up on the server, only the initial request to detect this should be sent. Since all other requests will also just fail, they should be blocked until the auth initialization is completed.

While the access token is getting refreshed, no request will succeed since the access token is expired; thus, they should not be sent.
2025-10-15 03:06:46 +02:00
schroda
f539afb404 Introduce "koration" duration api 2025-10-14 21:14:52 +02:00
schroda
f961e734bc Improve graphql ws client connection loss handling
- Retry on all disconnect events
- Retry infinitely
- Cap retry backoff strategy delay at heartbeat interval (20s)
- Recreate client in case reconnecting isn't working
2025-10-10 19:08:46 +02:00
schroda
f0c6e789cd Add backup flags to backup import 2025-10-07 22:27:07 +02:00
schroda
60f11a2832 Create backups via graphql api
Fixes #1022
2025-10-04 00:18:09 +02:00
schroda
ad3b8d4567 Update server injected subpath detection 2025-09-25 00:20:31 +02:00
Soner Köksal
4d4477640e Add dynamic subpath support (#1011)
* Add dynamic subpath support for WebUI

- Add SubpathConfig utility for server-side subpath detection
- Configure React Router basename from server config
- Update API base URL handling for subpath compatibility
- Fix asset loading with relative paths
- Add VITE_SUBPATH environment variable for development
- Update locales and manifest paths for subpath support

Closes #174

* Move VITE_SUBPATH interface to vite-env.d.ts

* Ensure production bundle always uses relative base
2025-09-23 23:23:19 +02:00
schroda
33fb30a399 Fix including credentials in gql client
Caused the basic auth popup to constantly open again

Regression 4aad410957
2025-08-27 01:10:09 +02:00
schroda
0bd3370d89 Add auth header only when necessary 2025-08-27 00:41:59 +02:00
schroda
4aad410957 Add "ui login" support 2025-08-26 23:06:44 +02:00
schroda
1b4bf22542 Rename folder "modules" to "features" 2025-08-15 22:02:58 +02:00
schroda
24a1fca8be Infer base url again on prod
Regression 5543e134fa
2025-08-13 11:03:54 +02:00
schroda
5543e134fa Use env vars 2025-08-02 23:14:21 +02:00
schroda
fed291a5dc Remove "__typename" prop from gql request variables
Will cause the request to fail in case the prop was not expected
2025-07-20 16:48:59 +02:00
schroda
bac77599f5 Add WebView support 2025-07-19 21:33:13 +02:00
schroda
0d23d8077f Add private tracking support 2025-07-19 21:33:12 +02:00
schroda
fad590eb5d Add "order" filter to chapters query key 2025-07-08 21:56:21 +02:00
schroda
592ca7881e Update download status query cache on external download enqueue
Downloads that got enqueued from outside the webui never got added to the download status query.
To be able to see them, a page refresh was required.
2025-06-28 01:21:31 +02:00
schroda
2e105a0539 Introduce "Extension info" screen 2025-06-23 00:05:16 +02:00
schroda
1721c15079 Properly reset state after backup import 2025-06-08 18:47:33 +02:00
schroda
29d0e3ae55 Update download status state via subscription
The download query type (DownloadStatus) and download subscription type (DownloadUpdates) are different.
This means that the download state in the cache does not get automatically updated from the state provided in the subscription.
2025-05-30 21:26:35 +02:00
schroda
76167ebb67 Set sensible gql ws-client retry attempt count 2025-04-18 00:34:22 +02:00
schroda
b673047517 Update to server gql library update changes 2025-03-23 04:04:08 +01:00
Jack
9e5fa7d81a Add history page (#897)
* Add History module and integrate it into the app

Introduce the History module with components for displaying chapter updates, including UI for grouped updates by date. Update routing and constants to incorporate the new /history path.

* Replace "Updates" and "History" with unified "Recent" module

Merged the "Updates" and "History" screens into a single unified "Recent" module with corresponding navigation updates. Adjusted GraphQL types and localization files to reflect the changes. This simplifies navigation and improves user experience.

* Refactor History screen to remove unused components.

Removed unused states, layout effects, and props related to last update timestamp. Renamed variables for better clarity and updated labels and error messages to align with the history context. Simplified component structure for improved maintainability.

* ```
Refactor tab handling and integrate dynamic height adjustments.

Renamed enums for better clarity and consistency. Implemented a `tabsMenuHeight` prop to dynamically adjust component layouts based on observed height changes using `useResizeObserver`. Updated the `Updates` component to consider the calculated heights for improved rendering.
```

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* "Optimize GraphQL type definition formatting in generated file

Condensed the formatting of the GetChaptersHistoryQuery type to a single line for improved readability and consistency. This change does not affect functionality but enhances maintainability of the generated code."

* Remove UpdateChecker component from History screen

The UpdateChecker component and its related navbar action have been removed from the History screen. This simplifies the navbar setup and eliminates unused functionality in this context.

* Refactor chapter fragment and type references

Updated `ChapterRecentListFieldsFragment` to `ChapterUpdateListFieldsFragment` for better alignment with naming conventions. Adjusted type imports and query structures to maintain consistency across files. No functional changes introduced.

* Refactor padding calculation logic in Updates screen.

Renamed state variable and refactored its logic for clarity and consistency. The updated logic now uses a more descriptive name, `listPadding`, to enhance code readability and maintainability.

* Pass `tabsMenuHeight` prop to History component

Added `tabsMenuHeight` prop to the `History` component to properly calculate the height for the `StyledGroupedVirtuoso` element. This ensures consistency with other components and improves layout rendering.

* Revert package.json

* Add last page read tracking to chapter history

Introduced "lastPageRead" and "pageCount" fields to track progress in chapter history. Updated UI to display the last page read along with total pages for chapters. Adjusted localization files to support the new "page" label.

* Remove last page read display from ChapterHistoryCard

The "last page read" information was removed from the ChapterHistoryCard component for a cleaner UI. This change simplifies the card's design by showing only the chapter name and relevant download state.

* Forcing an empty commit.

* Replace "Recent" screen with separate "Updates" and "History".

The "Recent" feature has been split into two distinct screens, "Updates" and "History", for improved clarity and functionality. Routes, icons, and components have been updated accordingly, and redundant code related to "Recent" has been removed.

* Clean

* Revert vi.json

* Remove unnecessary `useLocation` hook and update state logic.

The `useLocation` hook was removed as it was not used elsewhere in the component. The state property for the routing logic was updated to use `Chapters.getReaderOpenChapterLocationState` for better encapsulation and clarity.

* Update history localization by removing unused "page" key

Removed the "page" key from the "history" section in the localization file as it is no longer in use. This cleanup helps keep the translation file consistent and easier to maintain.

---------

Co-authored-by: NamNH <namitonguyen@gmail.com>
2025-03-10 21:53:40 +01:00
schroda
3698c19aba Properly enable cors for images by default 2025-01-26 17:18:27 +01:00
schroda
25e3fc7808 Load images with cors allowed
Without allowing cors it is e.g. not possible to extract colors from an image
2025-01-26 04:20:59 +01:00
schroda
a56fd08bf6 Include http status on rest fetch failure 2025-01-26 03:30:35 +01:00
schroda
c42e51b6f9 Infer server port only in dev env 2025-01-23 13:15:08 +01:00
schroda
63a6cfcfb3 Add merge function for "DownloadStatus" "queue" field 2025-01-12 20:55:08 +01:00
schroda
e25aa98365 Do not update "download status" on "download updates"
For large download queues this makes the app unusable.

At the moment this is not needed anyway and once it is, it needs to be improved and only be done in the "download queue" page since the queue is only use there
2025-01-12 20:47:16 +01:00
schroda
10a77722cc Remove outdated "download types" from apollo cache 2025-01-12 20:28:20 +01:00
schroda
94b0e25df2 Update "apollo-upload-client" to v18.x
- apollo-upload-client v18.0.1
- @types/apollo-upload-client v18
2024-12-24 14:19:40 +01:00
schroda
89cab26f73 Fix typing after "apollo-client" update to v3.12.4 2024-12-24 00:36:26 +01:00
schroda
a607f7f368 Reader settings 2024-12-09 02:38:37 +01:00
schroda
7434ed0152 Reader progress bars 2024-12-09 02:38:37 +01:00
schroda
12e8939267 Prevent duplicated downloads in download queue
The mutation to add chapters to the download queue returns the current download queue.

Thus, the local queue already includes the new downloads and adding them blindly in the download subscription will cause them to be in the local queue twice.
2024-12-09 02:38:37 +01:00
schroda
a819d45489 Update to server download subscription changes 2024-11-28 12:17:55 +01:00