Project

General

Profile

Edit Copy Actions

Feature #10409

open

Feature #10408: Subscription branch issues both optimization and fixing existing issues

Assets and documents issues and optimization

Added by Divya Inapakurthi about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Target version:
-
Start date:
08/17/2026
Due date:
08/17/2026 (32 days late)
% Done:

100%

Estimated time:

Add

Subtasks


Add

Related issues

Updated by Divya Inapakurthi about 1 month ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
  1. Summary of Fixes & Optimizations for Assets & Documents
  1. 1. Eliminated Duplicate 304 Refetch API Requests
    - Issue: Asset deletion/revert actions triggered duplicate GET API requests back-to-back—the 1st returned `200 OK` (13.8 KB), and a 2nd request arrived milliseconds later returning `304 Not Modified`.
    - Root Cause: `queryClient.invalidateQueries` was executing twice: once inside `useMutation.onSuccess` and again inside a redundant `useEffect` listening to `mutation.isSuccess`.
    - Fix: Removed duplicate `useEffect` hooks in `AssetTab.tsx` and `DocumentTab.tsx`. Invalidation now executes strictly once inside `onSuccess`.
  1. 2. Consolidated `deletedAssetsData` into Single Unified `assetsData` Query
    - Issue: Maintaining separate `deletedAssetsData` and `assetsData` queries created state desynchronization and bloated ternary logic (`showDeletedAssets ? deletedAssets : assets`).
    - Fix: Unified active and deleted document/asset fetching under a single `assetsData` query hook by incorporating `showDeletedAssets` into `queryParams`.
    - Benefit: React Query's `['assets', queryParams]` automatically caches active and deleted records in memory separately. Cleaned up redundant ternary logic across tables and loading skeletons.
  1. 3. Removed Dead Code & Unused Parameters
    - `DocumentTab.tsx`: Removed the unused physical assets status `else` branch. Simplified `fetchAssets` to focus purely on Document querying (`type=Document`).
    - `AssetTab.tsx`: Removed the unused document `else if (tabValue === 1)` branch. Simplified `fetchAssets` to focus purely on Physical Asset querying (`neId=...` + status filters).
  1. 4. Enhanced Search & Pagination UX
    - Auto-reset Page on Search: Added an effect in both tabs to reset `currentPage` to `1` whenever search input changes (prevents empty table views when searching from Page 2+).
    - Out-of-Bounds Page Adjuster: Added an effect that auto-adjusts `currentPage` back to `1` if filtering/search reduces total pages below the active page index.
  1. 5. Data Scope & UI Label Fixes
    - Active Document Count Protection: Constrained `setTotalDocuments` in `DocumentTab.tsx` so deleted document totals do not overwrite active document statistics.
    - Empty State Table Labels: Corrected empty table messages to display `"No deleted documents found."` in `DocumentTab.tsx` and `"No deleted assets found."` in `AssetTab.tsx`.
Actions #2

Updated by Divya Inapakurthi about 1 month ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
Edit Copy Actions

Also available in: Atom PDF