fix(sandbox): declarative engine strips JSONC comments inside strings; sql.format and sql.parse are regex-based
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 75/100
Rechercherichtung
Read lib/core/extensions/sandbox/embedded/declarative_embedded_engine.dart alongside lib/core/theme/parser/jsonc_preprocessor.dart and the core/database helper mentioned for leading comments. Check the editor fix in issue #1566 for the segment-aware SQL formatter. Add tests for the listed JSONC and SQL cases; done means strings remain intact, trailing commas parse, and sql.parse skips leading comments.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
DeclarativeEmbeddedEngine (lib/core/extensions/sandbox/embedded/declarative_embedded_engine.dart) runs Level-1 JSON/JSONC modules for extensions. Three of its helpers use regexes where a scanner is needed:
_parseJsoncObject(:230-238) breaks on any//or/*inside a string. It removes comments with//[^\n]*and/\*[\s\S]*?\*/over the raw text, so{"homepage": "https://example.com"}becomes{"homepage": "https:and the module fails withFormatException. Trailing commas, which JSONC allows, are not handled either. The repo already has a correct scanner:stripJsoncinlib/core/theme/parser/jsonc_preprocessor.dart(string-aware, handles trailing commas). Use it.sql.format(:120-164) changes literals and does extra work. It compiles 21RegExps per call (one per keyword plus two) and makes 23 passes over the string.[ \t]+ -> ' 'collapses spaces inside string literals;\s*;\s* -> ';\n'inserts newlines inside literals; keyword uppercasing rewrites'order by'and"select". Use the segment-aware formatter from the editor fix (#1566) instead of a second implementation.sql.parse(:219) splits the whole statement on whitespace to read the first word, and returns--//*when the statement starts with a comment. Use onefirstMatchafter skipping leading comments (stripLeadingWhitespaceAndLineCommentsexists in core/database).
Scope
EmbeddedSandboxRuntime has no callers outside lib/core/extensions/sandbox/embedded/ yet (only tests), so nothing breaks for users today. Fix before the runtime is wired to extensions.
Tests
JSONC with a URL value, /* inside a string, trailing comma; sql.format with keywords and ; inside literals; sql.parse with a leading comment.
- Vorherrschende Sprache
- Dart
- Sterne
- 23
- Forks
- 1
- Ø Merge
- 35 Min.
- Gemergte PRs (30 T.)
- 497
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus QueryaHub/Querya-Desktop
-
enhancement ui
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
QueryaHub/Querya-Desktop#1689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowOffenbug frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
QueryaHub/Querya-Desktop#1642 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug error-handling settings
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
QueryaHub/Querya-Desktop#1637 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
QueryaHub/Querya-Desktop#1636 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement marketplace
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
QueryaHub/Querya-Desktop#1635 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in QueryaHub/Querya-Desktop
Ähnliche Issues
-
bug enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
AOSSIE-Org/Ell-ena#356 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
espresso3389/pdfrx#776 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
MostroP2P/app#881 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[기능 제안]Offenenhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
atsign-foundation/at_server#2896 ·
Maintainer antworten meist innerhalb von 1 Tag