Skip to content

Remove legacy XML response code (closes #29)#31

Merged
w3spi5 merged 5 commits intomainfrom
develop
Dec 30, 2025
Merged

Remove legacy XML response code (closes #29)#31
w3spi5 merged 5 commits intomainfrom
develop

Conversation

@w3spi5
Copy link
Owner

@w3spi5 w3spi5 commented Dec 30, 2025

Resolution

After investigation, the XML code was actually dead legacy code from 2013 — the frontend already uses JSON via SSE.

What was removed (~140 lines):

  • createXmlResponse(), xmlElement(), formatNullable(), createProgressBar() from AjaxService
  • ajaxImport() from BigDumpController
  • ajax_import route from Application

What was kept (already JSON):

  • sseImport() — active SSE streaming endpoint
  • preview(), history(), filesList() — already return JSON
  • All frontend JS — already using JSON.parse() / response.json()

Verification:

  • ✅ 44/44 tests passing
  • ✅ Manual SSE import tested in browser

  SSE Reliability Fixes:
  - Fix PHP session locking blocking SSE connections
  - Add session_write_close() before rendering import page
  - Add SSE retry mechanism with exponential backoff (100ms-1600ms)
  - Fix output buffering order in SseService (ini_set before ob_end_clean)
  - Add ~8KB padding to force Apache/mod_fcgid buffer flush
  - Change return to exit after SSE error to prevent Response corruption

  Documentation:
  - Add "How It Works" section explaining staggered import behavior
  - Enhance Troubleshooting with Laragon-specific config paths
  - Add quick diagnostic command (php -S localhost:8000)
  - Document server configurations for SSE (Apache, nginx, Laragon)

  Git Cleanup:
  - Fix .gitignore to use **/CLAUDE.md pattern for all subdirectories
  - Remove CLAUDE.md files from git tracking
Add support for .bz2 and .sql.bz2 compressed SQL dump imports alongside
  existing .gz support, with full resume functionality via seek workaround.

  Key features:
  - BZ2 file detection with case-insensitive extension matching
  - bzopen/bzread/bzclose integration in FileHandler
  - ADR-001: Seek workaround using re-read strategy (O(n) resume time)
  - Conditional support based on PHP ext-bz2 availability
  - Purple "BZ2" badge in file listing
  - Frontend validation with custom error messages
  - Comprehensive test suite (24 tests across 4 files)

  Files modified:
  - src/Models/FileHandler.php - Core BZ2 support
  - src/Config/Config.php - Extension config + isBz2Supported()
  - templates/home.php - UI badge + data-bz2-supported
  - assets/js/fileupload.js - Conditional validation

  Test files created:
  - tests/FileHandlerBz2Test.php
  - tests/ConfigBz2Test.php
  - tests/FrontendBz2Test.php
  - tests/Bz2IntegrationTest.php
  - tests/fixtures/test_bz2_import.sql.bz2
@w3spi5 w3spi5 merged commit e5bda95 into main Dec 30, 2025
2 checks passed
w3spi5 added a commit that referenced this pull request Jan 13, 2026
* feat(sse): fix session locking and improve reliability

  SSE Reliability Fixes:
  - Fix PHP session locking blocking SSE connections
  - Add session_write_close() before rendering import page
  - Add SSE retry mechanism with exponential backoff (100ms-1600ms)
  - Fix output buffering order in SseService (ini_set before ob_end_clean)
  - Add ~8KB padding to force Apache/mod_fcgid buffer flush
  - Change return to exit after SSE error to prevent Response corruption

  Documentation:
  - Add "How It Works" section explaining staggered import behavior
  - Enhance Troubleshooting with Laragon-specific config paths
  - Add quick diagnostic command (php -S localhost:8000)
  - Document server configurations for SSE (Apache, nginx, Laragon)

  Git Cleanup:
  - Fix .gitignore to use **/CLAUDE.md pattern for all subdirectories
  - Remove CLAUDE.md files from git tracking

* feat(compression): add BZ2 (bzip2) compressed file support

Add support for .bz2 and .sql.bz2 compressed SQL dump imports alongside
  existing .gz support, with full resume functionality via seek workaround.

  Key features:
  - BZ2 file detection with case-insensitive extension matching
  - bzopen/bzread/bzclose integration in FileHandler
  - ADR-001: Seek workaround using re-read strategy (O(n) resume time)
  - Conditional support based on PHP ext-bz2 availability
  - Purple "BZ2" badge in file listing
  - Frontend validation with custom error messages
  - Comprehensive test suite (24 tests across 4 files)

  Files modified:
  - src/Models/FileHandler.php - Core BZ2 support
  - src/Config/Config.php - Extension config + isBz2Supported()
  - templates/home.php - UI badge + data-bz2-supported
  - assets/js/fileupload.js - Conditional validation

  Test files created:
  - tests/FileHandlerBz2Test.php
  - tests/ConfigBz2Test.php
  - tests/FrontendBz2Test.php
  - tests/Bz2IntegrationTest.php
  - tests/fixtures/test_bz2_import.sql.bz2

* build: Auto-compiled assets [skip ci]

* remove legacy XML response code (closes #29)
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

Comments