@sap/cds-mtxs
Advanced tools
Comparing version 1.14.2 to 1.14.3
@@ -9,2 +9,19 @@ # Change Log | ||
## Version 1.14.3 - 2024-01-18 | ||
### Fixed | ||
- i18n translations missing in some Java setups are now correctly resolved. | ||
- CSNs loaded in a worker thread are correctly linked. In earlier versions, this could lead to a stack overflow in projects having `cds.requires.db.schema_evolution: false` and cyclic actions such as this: | ||
```cds | ||
entity C_Books as projection on Books { * } actions { | ||
action returnSelf() returns C_Books; | ||
} | ||
``` | ||
- Sync upgrades for `tenants = *` with `clusterSize > 1` are working correctly. | ||
### Changed | ||
- The temporary workaround for `cds.env.requires.['cds.xt.ModelProvideService'].loadSync = true` is removed. This setting won't have an effect for future versions. | ||
## Version 1.14.2 - 2024-01-04 | ||
@@ -16,3 +33,3 @@ | ||
- `POST /-/model-provider/getEdmx` re-compiles the EDMX if a `model` is passed. | ||
- More resilient retry handling for 'authentication failed' errors in HANA deployments. | ||
- More resilient retry handling for 'authentication failed' errors in SAP HANA deployments. | ||
@@ -19,0 +36,0 @@ ## Version 1.14.1 - 2023-12-21 |
{ | ||
"name": "@sap/cds-mtxs", | ||
"version": "1.14.2", | ||
"version": "1.14.3", | ||
"description": "SAP Cloud Application Programming Model - Multitenancy library", | ||
@@ -5,0 +5,0 @@ "homepage": "https://cap.cloud.sap/", |
@@ -32,3 +32,3 @@ const cds = require('@sap/cds/lib') | ||
const hana = require('../plugins/hana/srv-mgr') | ||
tenantToDbUrl = (await hana.getAll(tenants)).reduce((res, t) => { | ||
tenantToDbUrl = (await hana.getAll(tenants.length > 0 ? tenants : '*')).reduce((res, t) => { | ||
const id = t.tenant_id ?? t.labels.tenant_id[0] | ||
@@ -42,3 +42,3 @@ if (!t.credentials) throw new Error('Credentials for tenant ' + id + ' are not available.') | ||
const dbToTenants = {} | ||
for (const tenant of tenants) { | ||
for (const tenant of Object.keys(tenantToDbUrl)) { | ||
const dbUrl = tenantToDbUrl[tenant] | ||
@@ -144,4 +144,3 @@ if (!dbToTenants[dbUrl]) dbToTenants[dbUrl] = new Set | ||
const ds = await cds.connect.to(DeploymentService) | ||
await this.limiter(clusterSize, dbToTenants, tenants => | ||
await this.limiter(clusterSize, Object.values(dbToTenants), tenants => | ||
this.limiter(workerSize ?? poolSize, Array.from(tenants), t => ds.tx({tenant:t}, tx => tx.upgrade(t, options))) | ||
@@ -148,0 +147,0 @@ ) |
@@ -162,23 +162,13 @@ const crypto = require('crypto') | ||
let csn | ||
if (cds.requires?.['cds.xt.ModelProviderService']?.loadSync) { // REVISIT: Temporary fix for problems with serializing CSN | ||
csn = await lru4(baseCache, JSON.stringify({ models, flavor }), async () => { | ||
const csn = await cds.load(models, { flavor, silent:true }) | ||
return csn.meta?.flavor === 'inferred' ? cds.minify(csn) : csn | ||
}) | ||
} else { | ||
csn = await lru4(baseCache, JSON.stringify({ models, flavor }), () => | ||
worker4(path.join(__dirname, 'worker/load.js'), { models, flavor }) | ||
) | ||
} | ||
let csn = await lru4(baseCache, JSON.stringify({ models, flavor, javaornode }), () => | ||
worker4(path.join(__dirname, 'worker/load.js'), { models, flavor, javaornode }) | ||
) | ||
csn = cds.reflect(csn) | ||
if (extensions) { | ||
const key = crypto.createHash('sha256').update(JSON.stringify({ extensions, models })).digest('hex') | ||
const key = crypto.createHash('sha256').update(JSON.stringify({ extensions, models, javaornode })).digest('hex') | ||
csn = lru4(extensionCache, key, () => cds.extend (csn) .with (extensions)) | ||
} | ||
// shallow clone to avoid side-effects by cds.compile.for (modifying input CSN), called by SQLite deploy and HANA extend | ||
if (javaornode) csn = cds.compile.for[javaornode] ({ ...csn }) | ||
if (javaornode) csn = cds.compile.for[javaornode] (csn) | ||
// Dirty hack for cds.localize in Node sidecar setup | ||
Object.defineProperty (csn,'$sources',{ value:csn.$sources, enumerable:true }) | ||
return csn | ||
@@ -199,3 +189,3 @@ } | ||
let _csn = cache.get(key) | ||
if (_csn) { | ||
if (_csn) { // cache hit: update map insertion order -> key is last in queue again | ||
cache.delete(key) | ||
@@ -202,0 +192,0 @@ cache.set(key, _csn) |
@@ -8,9 +8,2 @@ const cds = require('@sap/cds/lib'), {db} = cds.env.requires | ||
// Check hana credentials to alert as early as possible | ||
if (db?.kind === 'hana' && !db.credentials?.sm_url) { | ||
cds.error('No HANA credentials found. Make sure the application is bound to a BTP Service Manager instance.') | ||
} | ||
const useOldIm = cds.env.requires['cds.xt.DeploymentService']?.['old-instance-manager'] | ||
const hana = useOldIm ? require('./hana/inst-mgr') : require('./hana/srv-mgr') | ||
const TEMP_DIR = require('fs').realpathSync(require('os').tmpdir()) | ||
@@ -25,3 +18,7 @@ const { readData } = require('../extensibility/utils') | ||
if (db?.kind === 'hana') { | ||
if (!db.credentials?.sm_url) cds.error('No HANA credentials found. Make sure the application is bound to a BTP Service Manager instance.') | ||
const useOldIm = cds.env.requires['cds.xt.DeploymentService']?.['old-instance-manager'] | ||
const hana = useOldIm ? require('./hana/inst-mgr') : require('./hana/srv-mgr') | ||
exports.activated = 'HANA Database' | ||
@@ -28,0 +25,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
240537
4588