v6.1.5: Query rendering overhaul, metadata optimization, and date-only formatting
SQL query rendering and composition are completely overhauled across SQL Server and PostgreSQL, timezone-agnostic SQL date rendering prevents date-shifting display errors across grids, timelines, and exports, and metadata reloads no longer serialize the entire graph to local storage, preventing out-of-memory crashes; plus Playwright test harness, durable entity action parameters, real-time OpenAI session, and Open App schema fixes.
Upgrade Notes apply: two migrations run on mj migrate and must run before the 6.1.5 MJAPI starts, queued durable tasks require input payload adjustment, Open App schema upgrades enforce control checks, and CodeGen must be run for PostgreSQL tsvector/tsquery mapping and nullable column fixes.
MemberJunction 6.x is released under the Business Source License 1.1; 5.x and earlier stay ISC. What the licence grants, and what needs certification, is in the licence section of the v6 upgrade guide.
New Features
Section titled “New Features”- One-turn implicit agent completion (
@memberjunction/ai-agents,@memberjunction/ai-prompts): Adds a newcomplete_taskcontrol tool that applies the final payload change and finishes an implicit-mode agent task run in a single turn. This eliminates forcing an extra schema-constrained turn that could result in empty payload requests and execution failures. - PostgreSQL access monitoring (
@memberjunction/server): Emits a warning at server startup if the PostgreSQL read-only database login has excessive permissions, such as direct read access to base tables or server-level files, helping maintain proper database isolation boundaries. - Query row-capping indicators (
@memberjunction/core,@memberjunction/generic-database-provider): Adds the capability to report back to callers whether a requested query row cap was applied at the database level, and logs instances when it was not.
Improvements
Section titled “Improvements”- Metadata snapshot memory and performance optimizations (
@memberjunction/core,@memberjunction/redis-provider,@memberjunction/graphql-dataprovider,@memberjunction/mobile-app,@memberjunction/testing-integration): Stops serializing the entire metadata graph into local in-memory storage on every reload, preventing massive transient memory spikes, garbage collection pauses, and server out-of-memory (OOM) crashes. Introduces the optionalSupportsCrossProcessPersistencecapability to skip redundant snapshot reads and writes, and replaces slow byte-by-byte base64 loops with Node’s native buffer codecs. Additionally, growing telemetry event, insight, pattern, and deduplication collections are now properly bound and pruned. - Playwright test harness memory and stability bounds (
@memberjunction/react-test-harness): Eliminates target page crashes and out-of-memory failures in the test harness by projecting only necessary entity properties to the browser page rather than cloning the entire metadata graph, capping console logs to 5,000 messages (32KB per message), and slicing HTML captures in the browser page before serialization. - SQL-level paging on MaxRows alone (
@memberjunction/generic-database-provider): Enables database-level paging when a caller specifiesMaxRowswithoutStartRow, defaulting the start row to page zero. Callers now receive optimized SQL-level paging instead of fetching every row over the network and trimming them in memory, saving substantial network transfer and memory overhead. - Zero-preload React and Babel in real-time widgets (
@memberjunction/ng-artifacts,@memberjunction/ng-explorer-core): Removes the eager preloading of React, ReactDOM, and Babel from the unpkg CDN on construction. Applications that only load real-time overlays (e.g., a public voice widget) no longer make third-party CDN requests at bootstrap, while MemberJunction Explorer retains a warm cache by preloading only after user authentication.
Bug Fixes
Section titled “Bug Fixes”- SQL query rendering, parsing, and composition overhaul (
@memberjunction/sql-parser,@memberjunction/sql-dialect,@memberjunction/generic-database-provider,@memberjunction/core,@memberjunction/core-entities-server,@memberjunction/postgresql-dataprovider,@memberjunction/server,@memberjunction/integration-test-suite,@memberjunction/sqlserver-dataprovider,@memberjunction/graphql-dataprovider,@memberjunction/query-processor): Resolves a wide range of query execution bugs across SQL Server and PostgreSQL platforms. This includes ensuring a query’s own limits/paging are preserved alongside a caller’sMaxRows, resolving CTE naming collisions, enforcing single-query execution for caller-supplied SQL, and blocking dangerous system function calls (e.g.,OPENROWSET,dblink, file readers). Also ensures that ad-hoc SQL over GraphQL (ExecuteAdhocQuery) routes through the read-only provider’s ad-hoc path, applying a server-enforced timeout. - Durable entity action parameters resolution (
@memberjunction/actions-base,@memberjunction/actions,@memberjunction/task-graph,@memberjunction/server,@memberjunction/integration-test-suite,@memberjunction/ng-dashboards): Fixes a critical failure where the dispatcher’s payload merge silently dropped array-based redacted parameters, causing all durable entity actions (RunMode = 'Durable') to run without inputs and fail with missing parameter errors. Parameters are now formatted as a name-value object viaRedactParamsToRecord(), and parameter redactions are checked against live engine definitions to avoid stale cached configurations. Additionally, task executions with invalid JSON payloads now fail loudly with detailed feedback, and the Workflows run view displays “Why it failed” directly to users instead of burying details in the JSON tab. - Business Central connection and accounting verb dispatching (
@memberjunction/actions-bizapps-accounting): Fixes SQL Server multi-part identifier errors on connection lookups, resolvesbusiness-centralintegration aliases, adds theCompanyIntegrationIDparameter to prevent arbitrary “first match” selections on ambiguous company connections, implements connector-style authorization via Entra ID andOAuth2TokenManagerfor client credentials, and prevents leaking secrets inside JSON parsing error logs. - Real-time voice session identity retention (
@memberjunction/ai-realtime-client,@memberjunction/ai-openai): Fixes a character-breaking bug where callingRequestSpokenUpdateoverrode and wiped the session’s overall system instructions and persona in the OpenAI Realtime protocol. Both client and server drivers now preserve and prepend the session prompt ahead of the new instructions. - Timezone-agnostic date-only SQL rendering in grids, cards, and panels (
@memberjunction/core,@memberjunction/ng-entity-viewer,@memberjunction/ng-entity-card,@memberjunction/ng-base-forms): Prevents SQLdatecolumns (which arrive as UTC midnight) from being shifted to the previous calendar day when displayed west of Greenwich. Adds timezone-agnostic formatting usingIsDateOnlySQLTypeandFormatDateOnlyacross grids, cards, detail panels, view-config previews, and FK dropdowns. - Timezone-agnostic date-only SQL rendering in queries, change histories, and exports (
@memberjunction/export-engine,@memberjunction/mobile-app,@memberjunction/ng-entity-viewer,@memberjunction/ng-explorer-core,@memberjunction/ng-query-viewer,@memberjunction/ng-record-changes,@memberjunction/ng-timeline): Extends timezone-agnostic date-only formatting to the query viewer, record change history/restore previews, and timeline segments. Introduces adateonlyexport type to ensure Excel, CSV, and JSON exports write the exact stored calendar day instead of a localized string. - Magic-link redemption permissions (
@memberjunction/server): Fixes single-use magic-link redemption on hosts where the API database login lacks database-owner (db_owner) privileges on SQL Server. Uses a dedicated, role-granted stored procedure (spConsumeMagicLinkInvite) instead of running a direct UPDATE against theMagicLinkInvitebase table. - Open App schema ownership chaining (
@memberjunction/open-app-engine): Resolves permissions issues on SQL Server by ensuring Open App schemas are created owned by the core schema’s owner (usuallydbo), allowing ownership chaining to grant app views access to core tables without per-table grants. - Real-time voice session saving for anonymous users (
@memberjunction/core-entities,@memberjunction/server,@memberjunction/ai-agents): Permits hidden tool-execution and artifact conversation turns to save during anonymous magic-link voice sessions. These writes were previously rejected because they ran as the system user, who did not own the conversation. - PostgreSQL full-text search and vector columns CodeGen support (
@memberjunction/sql-dialect,@memberjunction/ng-explorer-core): Maps the PostgreSQLtsvectorandtsquerytypes as GraphQLStringinstead of omitting them (which caused CodeGen to fallback toInt, breaking record loads when the full-text search vector was populated). Also enables the standalone artifact tab (ArtifactResource) to properly processopenEntityRecordandnavigationRequestevents. - Nullable GraphQL fields for nullable geocoding columns (
@memberjunction/codegen-lib): Fixes an issue where nullable columns (specifically geocoding fields like__mj_Latitudeand__mj_Longitude) were generated as non-nullable GraphQL fields, causing single-record load queries to crash on null values. - Double-quoting in SQL template placeholder literals (
@memberjunction/sql-parser): Prevents SQL parser placeholder substitution from doubling quotes around template expressions that are already inside a quoted literal, which previously resulted in unparseable SQL and empty query fields. - Implicit-mode agent control flow and Claude/Gemini failover corrections (
@memberjunction/ai-agents,@memberjunction/ai-prompts,@memberjunction/ai-gemini,@memberjunction/ai-vertex,@memberjunction/ai-anthropic,@memberjunction/ai,@memberjunction/core-entities,@memberjunction/testing-engine): Cleans up prompt templates to omit instructions for JSON envelopes when the model is in implicit control mode, handles unreadable JSON text as a retry rather than an empty final response, ensures Gemini thought signatures are only replayed where they were minted to prevent 400 errors during failover, and falls back to'auto'tool selection for Claude models that reject forced choices.
Upgrade Notes
Section titled “Upgrade Notes”- Run
mj migratebefore starting the 6.1.5 MJAPI. Two migrations apply. On SQL Server, a 6.1.5 server whose database has not run them returns500on every magic-link redemption, including every MJ Forms public link, ondb_ownerhosts too.- One schema migration (
V202609291627__v6.2.x__MagicLink_Consume_Invite_Sproc.sql, the 6.1.5 security exception) addsspConsumeMagicLinkInviteand grants EXECUTE on it tocdp_Developerandcdp_Integration. No table, view or column change. PostgreSQL has no counterpart and needs none. - One metadata migration (
V202610061630__v6.2.x__Line_Metadata_Sync_Native_Tool_Calling.sql, line-only) carries the data half of the native tool-calling fixes: 32 updates, no creates or deletes. Claude Fable 5.1 is marked as rejecting forced tool choice, and every Loop agent gets the new implicit-mode system prompt, so watch agent runs after the upgrade. It also updates theIAIConfigurationJSON type’s entity fields. Rows you hand-edited among these are overwritten, as with any metadata sync.
- One schema migration (
- Outstanding durable tasks must be updated or re-triggered (
@memberjunction/actions-base,@memberjunction/actions,@memberjunction/task-graph,@memberjunction/server,@memberjunction/integration-test-suite): Durable tasks queued before this release carry parameters stored as arrays rather than name-value objects. These tasks will now fail loudly (Task <id> has an InputPayload that is an array; expected a name → value object…) instead of running with silently dropped inputs. Users can re-trigger the source save, or use the Edit input & retry control in the Workflows run view to replace the stored array with a name-value object. - SQL Server Open App schema upgrades enforce CONTROL checks (
@memberjunction/open-app-engine): Upgrades and installs that reuse an existing schema on SQL Server now check that the database login hasCONTROLpermissions on the app schema. If retrofitting an existing install to run schema-owner changes, runningALTER AUTHORIZATIONon SQL Server to change ownership of the schema will drop the schema’s grants (including objects, columns, types, and XML collections). - CodeGen must be re-run for PostgreSQL tsvector/tsquery and nullable column fixes (
@memberjunction/codegen-lib,@memberjunction/sql-dialect): If you use PostgreSQL full-text search columns or nullable fields that were previously mapped as non-nullable GraphQL fields (e.g. geocoding fields), you must re-runmj codegenand rebuild your hosts and apps to regenerate the affected entity schemas and avoid runtime query load failures.