Say on the card when a project's own file was ignored
An unknown field discards the whole declaration rather than the key it did not recognise, so a machine that takes a project's commit before it takes a dev-updater that understands it loses that project's components, strip, staleWhen and resources at once. Nothing looks broken afterwards: the card becomes a project that declares nothing, which is the ordinary case, and the only thing saying otherwise was a line in this server's log on a machine the person holding the phone cannot read. project_config now answers a ProjectFile carrying the parse error beside the declaration, and AppEntry::declaration_state returns both halves from one read -- the manifest wants both, and the file is on that path. The card draws its own sentence about what it means and what to do, then the parser's own words, which name the file, the position and the offending field; that half is selectable, since the fix happens on the other machine. Nothing is blocked by it. What was already accepted is what runs, so an unrelated typo cannot stop a project that was working -- asserted in the test, along with the error naming both the field and the file. Seen on the emulator both ways: a project whose file gained a field from the future says so under its action row, and the whole message goes when the file parses again. Raised by the tdep-survey session after its alsoWatch commit hit exactly this against the older binary running here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c7b3af4861
commit
0b7164bb30
8 files changed
+210
-28
No files matched your search
@@ -63,6 +63,14 @@ data class ManifestEntry(
|
||||
// Null once accepted, or for a project that asks for nothing. While it
|
||||
// is set the server runs no build step for this app at all.
|
||||
val pendingDeclaration: String?,
|
||||
// Why this project's own .dev-updater.ron was ignored, when it could
|
||||
// not be read. Null covers both "it parsed" and "there is no file",
|
||||
// which are the same thing to a reader -- what this exists for is the
|
||||
// third case, where the file is there, says something, and none of it
|
||||
// is being used. An unknown field discards the whole declaration
|
||||
// rather than the key it did not recognise, so the card silently
|
||||
// becomes an emptier project instead of a broken one.
|
||||
val declarationError: String?,
|
||||
)
|
||||
|
||||
// A project's checkout, all read locally on the server.
|
||||
@@ -340,6 +348,7 @@ private fun readEntry(entry: JSONObject): ManifestEntry {
|
||||
checkError = entry.optString("checkError").ifEmpty { null },
|
||||
checkPending = entry.optBoolean("checkPending", false),
|
||||
pendingDeclaration = entry.optString("pendingDeclaration").ifEmpty { null },
|
||||
declarationError = entry.optString("declarationError").ifEmpty { null },
|
||||
components =
|
||||
(0 until (components?.length() ?: 0)).map { j ->
|
||||
val component = components!!.getJSONObject(j)
|
||||
|
||||
@@ -1919,6 +1919,29 @@ private fun AppCard(
|
||||
OutputText(reason, style = MaterialTheme.typography.bodySmall)
|
||||
}
|
||||
}
|
||||
// Said here, with the project's identity, because it is about
|
||||
// this project's own file rather than about any one component
|
||||
// -- and because what it costs is invisible further down: the
|
||||
// file is ignored *whole*, so the card quietly becomes an
|
||||
// emptier project, with components, strip and resources it
|
||||
// asked for simply not there. Nothing else on the card can say
|
||||
// that, since a project that declares nothing looks exactly
|
||||
// the same.
|
||||
//
|
||||
// Two parts, and the split is the usual one: this app's own
|
||||
// sentence for what it means and what to do, then the parser's
|
||||
// own words -- which name the file, the line and the field --
|
||||
// selectable, because fixing it happens on the other machine.
|
||||
entry.declarationError?.let { reason ->
|
||||
Text(
|
||||
"This project's own file was ignored, so nothing it asks for is being " +
|
||||
"read. Fix it on the build machine, or update Dev Updater if the file " +
|
||||
"uses something newer than it knows.",
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = ActionTone.Caution.color,
|
||||
)
|
||||
OutputText(reason, style = MaterialTheme.typography.bodySmall)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user