fix: Firefox signing — manifest_version corruption + rate limiting

The sign script's sed command was replacing ALL "version" patterns
including "manifest_version": 3, corrupting it to "manifest_version": 1.
Fixed by anchoring the sed pattern to only match the top-level
"version" field (starts with two spaces at line beginning).

Also:
- Added data_collection_permissions to Firefox manifest (new Mozilla
  requirement for all extensions)
- Added 8-second sleep between retry attempts to avoid Mozilla API
  rate limiting (was causing cascading failures)

https://claude.ai/code/session_01SWSwDfMVij53bCTNSCLMwn
This commit is contained in:
Claude
2026-03-26 20:58:16 +00:00
parent 9be389f53a
commit 3ffac3299f
2 changed files with 16 additions and 6 deletions
+6 -1
View File
@@ -6,7 +6,12 @@
"browser_specific_settings": {
"gecko": {
"id": "silent-send@example.com",
"strict_min_version": "128.0"
"strict_min_version": "128.0",
"data_collection_permissions": {
"required": false,
"optional": false,
"description": "Silent Send does not collect, transmit, or store any data externally. All processing is 100% local in your browser."
}
}
},
"permissions": [
+10 -5
View File
@@ -30,10 +30,10 @@ NEW_VERSION="$MAJOR.$MINOR.$PATCH"
echo "Version: $CURRENT_VERSION$NEW_VERSION"
# Update all version references
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" "$MANIFEST"
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" "$MANIFEST_CHROME"
sed -i "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON"
# Update all version references (only top-level "version", not "manifest_version")
sed -i "s/^ \"version\": \"$CURRENT_VERSION\"/ \"version\": \"$NEW_VERSION\"/" "$MANIFEST"
sed -i "s/^ \"version\": \"$CURRENT_VERSION\"/ \"version\": \"$NEW_VERSION\"/" "$MANIFEST_CHROME"
sed -i "s/^ \"version\": \"$CURRENT_VERSION\"/ \"version\": \"$NEW_VERSION\"/" "$PACKAGE_JSON"
# Commit the version bump
cd "$SCRIPT_DIR"
@@ -113,7 +113,12 @@ for attempt in $(seq 1 $MAX_ATTEMPTS); do
PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$NEW_VERSION\"/" "$SCRIPT_DIR/dist/firefox/manifest.json"
# Only replace the top-level "version" field, not "manifest_version"
sed -i "s/^ \"version\": \"[^\"]*\"/ \"version\": \"$NEW_VERSION\"/" "$SCRIPT_DIR/dist/firefox/manifest.json"
# Wait before retrying to avoid Mozilla rate limiting
echo "Waiting 8 seconds before retry..."
sleep 8
done
echo "Error: Failed after $MAX_ATTEMPTS attempts."