Revision file generation
Target Audience: Internal staff, developers, support team
This document explains what design_versions.json is, why it’s needed, and how to generate it for 3D app cache management.
What is design_versions.json?
design_versions.json is a JSON file that contains an array of design version objects, each with a chunk ID and its revision count value.
Data Structure
[
{ "chunk_id": <design version chunk_id>, "revision_count": <current design version revision_count value> },
{ "chunk_id": <design version chunk_id>, "revision_count": <current design version revision_count value> },
...
]Example:
[
{ "chunk_id": 12345, "revision_count": 5 },
{ "chunk_id": 67890, "revision_count": 12 },
{ "chunk_id": 11223, "revision_count": 3 }
]Each array item contains:
- chunk_id: The design version’s
chunk_idfield from the database - revision_count: The current design version’s
revision_countvalue from the database
Why Do We Need It?
The 3D Desktop App uses this file to manage local caching and determine when to re-download design versions.
Cache Management Flow
- First time: 3D App downloads a design version and caches it locally
- Subsequent launches: 3D App checks
design_versions.json - If revision_count changed: App re-downloads the design version (new changes available)
- If revision_count unchanged: App uses cached version (faster load time)
Performance Impact
This mechanism significantly reduces loading times and bandwidth usage by only re-downloading design versions when they have actually been updated.
Where to Access It?
Direct S3 URL
https://app-catalog-rdesign.s3.amazonaws.com/design_versions.jsonYou can access this URL directly in your browser to view the current file contents.
AppVersion API Response
The file URL is also provided via the AppVersion API response:
{
"design_versions_url": "https://app-catalog-rdesign.s3.amazonaws.com/design_versions.json",
...
}The 3D App fetches the URL from this API field dynamically.
When is the File Generated?
Manual Process Required
Currently, there is no automated process to generate this file. The Peter team must manually trigger the generation when design versions are updated.
When to Regenerate
You should regenerate design_versions.json when:
- New design versions are published
- Existing design versions are updated (revision_count changed)
- Design versions are activated/deactivated
- After bulk design version updates
Important: Update After Changes
If you update design versions but forget to regenerate this file, the 3D App will continue using outdated cached versions, and users won’t see the latest changes.
How to Generate the File
Access the Admin Settings Page
- Log in to the admin dashboard
- Navigate to Admin Settings
- Find the “Generate design_versions.json” button
Generation Process
When you click the generate button, the system:
- Fetches all active design versions where
revision_countis NOT NULL - Extracts the
chunk_idfield from each design version - Builds the JSON data structure (chunk_id → revision_count mapping)
- Uploads the generated file to AWS S3
- Makes it available at the S3 URL
Data Filtering Rules
The system only includes design versions that meet ALL of these criteria:
- ✅ Status is active
- ✅
revision_countfield is NOT NULL - ✅
chunk_idfield exists
Typical File Size
For a catalog with 1000+ active design versions, the file is typically 20-50KB. The file size is minimal and downloads quickly.
Technical Specifications
File Format
- Format: JSON
- Content-Type:
application/json - Encoding: UTF-8
- Structure: Array of objects with
chunk_idandrevision_countfields
S3 Storage Details
- Bucket:
app-catalog-rdesign - Object Key:
design_versions.json - Access: Public read
- CDN: Served via CloudFront (if configured)
Database Query Logic
The generation process executes a query similar to:
SELECT chunk_id, revision_count
FROM design_versions
WHERE status = 'active'
AND revision_count IS NOT NULL
AND chunk_id IS NOT NULLTroubleshooting
Problem: 3D App Not Downloading Updated Design Versions
Possible Causes:
design_versions.jsonwas not regenerated after updatesrevision_countwas not incremented in the database- S3 file upload failed
- CDN cache not cleared (if using CloudFront)
Solution:
- Verify
revision_countwas incremented in database - Regenerate
design_versions.jsonvia admin settings - Check S3 to confirm file was uploaded
- Clear CDN cache if applicable
- Test by downloading the S3 URL directly
Problem: File Generation Failed
Possible Causes:
- AWS S3 credentials invalid or expired
- Insufficient S3 bucket permissions
- Database connection issues
Solution:
- Check Heroku environment variables for AWS credentials
- Verify S3 bucket permissions (PutObject)
- Check application logs for error messages
- Contact backend team if issue persists
Related Systems
Design Version Management
- Design versions are managed in the
design_versionstable - Each update should increment the
revision_countfield - Only active design versions with non-null revision counts are included
3D Desktop App Integration
- App fetches
design_versions_urlfrom AppVersion API on launch - Downloads and parses the JSON file
- Compares local cache revision counts with file values
- Re-downloads only changed design versions
AWS S3
- File stored in
app-catalog-rdesignbucket - Public read access required for 3D App downloads
- Upload handled automatically by the generate button
Best Practices
1. Regular Updates
Generate design_versions.json immediately after publishing or updating any design versions to ensure users receive the latest content.
2. Verification After Generation
After generating the file:
- Download it directly from the S3 URL
- Verify the file is valid JSON
- Check that updated design versions are included
- Confirm revision counts match the database
3. Communication
When regenerating the file:
- Notify the team in relevant Slack channels
- Document what changes were included
- Note the timestamp for reference
4. Monitoring
Regularly monitor:
- File accessibility (S3 URL returns 200 OK)
- File size (sudden changes may indicate issues)
- Last modified date (should match last generation)
Future Improvements
Planned Automation
Future development plans include:
- Automatic generation when design versions are published/updated
- Webhook or event-driven triggers
- Version history tracking
- Notification system for generation failures
Related Documents
Internal Documentation
External Documentation
- AWS S3 Documentation
- Design Version Management Guide (to be created)
Update History
- January 5, 2026: Initial version created