You've already forked DataMate
Problem: check_file_version was comparing annotation version with the passed file_id's version, but when files are updated, new file records are created with higher versions and old ones are marked ARCHIVED. Solution: 1. Query the latest ACTIVE file by logical_path 2. Compare annotation version with latest file version 3. Return latestFileId so frontend can switch to new version Changes: - check_file_version now queries latest version by logical_path - Added latest_file_id to FileVersionCheckResponse schema - Updated descriptions to clarify currentFileVersion is latest version Database scenario: - old file: id=6dae9f2f, version=1, status=ARCHIVED - new file: id=3365b4e7, version=3, status=ACTIVE - Both have same logical_path='rufus.ini' - Now correctly detects version 3 > annotation version