Skip to content

feat: implement error pages and apply base entity inheritance#106

Merged
antosubash merged 13 commits intomainfrom
feature/elastic-lamport
Apr 15, 2026
Merged

feat: implement error pages and apply base entity inheritance#106
antosubash merged 13 commits intomainfrom
feature/elastic-lamport

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Changes

Error Pages Implementation

  • Add custom error page components (404, 500, 403) in React with shared layout
  • Implement ForbiddenException with 403 HTTP status mapping
  • Add GlobalExceptionHandler middleware to render Inertia error pages for browser requests
  • Configure status code pages middleware with /error/{statusCode} endpoint
  • Add static error.html fallback for cases where dynamic rendering fails
  • Include error pages design specification and implementation plan

Base Entity Inheritance

  • Apply consistent base entity inheritance across all modules (Agents, BackgroundJobs, Chat, Datasets, Email, FeatureFlags, FileStorage, Orders, PageBuilder, Permissions, Products, RateLimiting, Settings, Tenants)
  • Update EF Core entity configurations to use HasNoKey() where appropriate
  • Add ID value objects (e.g., AgentMessageId, FeatureFlagId, SettingId) to contracts projects
  • Create comprehensive migration 20260411065821_UseBaseEntities

Supporting Changes

  • Add DatabaseOptionsExtensions for database configuration
  • Update exception handling and diagnostic emitter
  • Add TypeScript type definitions for new contracts
  • Update unit tests to reflect entity inheritance changes

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 12, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 909b60a
Status: ✅  Deploy successful!
Preview URL: https://6e168124.simplemodule-website.pages.dev
Branch Preview URL: https://feature-elastic-lamport.simplemodule-website.pages.dev

View logs

antosubash added a commit that referenced this pull request Apr 12, 2026
Replace all stub processors and converters with working implementations
that shell out to GDAL/OGR and tippecanoe for GIS file processing:

Processors (metadata extraction on upload):
- CogProcessor: gdalinfo -json for raster metadata
- ShapefileProcessor: unzip + ogrinfo/ogr2ogr for zipped shapefiles
- KmlProcessor: ogrinfo/ogr2ogr for KML files
- GeoPackageProcessor: ogrinfo/ogr2ogr for GPKG files
- PmTilesProcessor: binary v3 header reader with correct spec offsets

Converters (format conversion):
- VectorToPmTilesConverter: tippecanoe CLI for GeoJSON → PMTiles
- RasterToCogConverter: gdal_translate -of COG for raster → COG

Infrastructure:
- CliRunner: shared async process runner with concurrent stdout/stderr
  draining to prevent pipe-buffer deadlocks
- TempDirectory: IDisposable temp dir wrapper with auto-cleanup

Bug fixes:
- Register dataset jobs via AddModuleJob instead of AddScoped so the
  worker's JobTypeRegistry can discover and execute them
- Add Lazy<IEventBus> to worker extensions (mirrors host) to fix crash
  when SettingsService resolves via AuditSaveChangesInterceptor
- Fix ConvertDatasetJob to read from NormalizedPath for non-GeoJSON
  vector sources instead of the raw original file
- Point worker appsettings at shared host database and storage paths
antosubash added a commit that referenced this pull request Apr 13, 2026
… (#107)

Replace all stub processors and converters with working implementations
that shell out to GDAL/OGR and tippecanoe for GIS file processing:

Processors (metadata extraction on upload):
- CogProcessor: gdalinfo -json for raster metadata
- ShapefileProcessor: unzip + ogrinfo/ogr2ogr for zipped shapefiles
- KmlProcessor: ogrinfo/ogr2ogr for KML files
- GeoPackageProcessor: ogrinfo/ogr2ogr for GPKG files
- PmTilesProcessor: binary v3 header reader with correct spec offsets

Converters (format conversion):
- VectorToPmTilesConverter: tippecanoe CLI for GeoJSON → PMTiles
- RasterToCogConverter: gdal_translate -of COG for raster → COG

Infrastructure:
- CliRunner: shared async process runner with concurrent stdout/stderr
  draining to prevent pipe-buffer deadlocks
- TempDirectory: IDisposable temp dir wrapper with auto-cleanup

Bug fixes:
- Register dataset jobs via AddModuleJob instead of AddScoped so the
  worker's JobTypeRegistry can discover and execute them
- Add Lazy<IEventBus> to worker extensions (mirrors host) to fix crash
  when SettingsService resolves via AuditSaveChangesInterceptor
- Fix ConvertDatasetJob to read from NormalizedPath for non-GeoJSON
  vector sources instead of the raw original file
- Point worker appsettings at shared host database and storage paths
UseStatusCodePagesWithReExecute was re-executing POST/PATCH/PUT requests
that got bare 4xx responses from routing (e.g. auth 401/403, validation
failures) through /error/{statusCode}. Since the endpoint is MapGet-only,
non-GET methods returned 405 MethodNotAllowed instead of the original
status code. It also replaced JSON ProblemDetails with Inertia HTML for
API clients.

Scope the status code pages middleware to GET requests on non-service
paths (/api, /connect, /swagger, /health, /_framework, /_vite excluded).
Browser navigations still get the nice error page; API clients keep
their ProblemDetails body and bare status code.
UseStatusCodePagesWithReExecute was too aggressive — it re-executed on
ANY bare 4xx status code, including auth 401/403 from matched endpoints.
This broke unauthenticated access tests that expected bare 401 responses
(they got HTML error pages or 404 instead).

MapFallback only fires when no endpoint matches the URL, so browser
navigation to non-existent URLs gets a pretty Inertia 404 page while
auth failures on real endpoints keep returning their bare status code.

Also extracts the error-page render logic into a shared RenderErrorPage
helper used by both /error/{statusCode} and the fallback.
@antosubash antosubash merged commit c26fbbc into main Apr 15, 2026
5 checks passed
@antosubash antosubash deleted the feature/elastic-lamport branch April 15, 2026 11:44
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