-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding support for multi-tenancy #117
base: main
Are you sure you want to change the base?
Conversation
const meta = csn.meta ??= {} | ||
if (!("Attachments" in csn.definitions)) return | ||
if (meta._enhanced_for_attachments) return | ||
// const csnCopy = structuredClone(csn) // REVISIT: Why did we add this cloning? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done because when we convert csn
to LinkedCSN
(next line) the @source
property is deleted from the definitions of kind service
in the csn
. This was leading to deployment failures in production with the below error when files were present inside a folder in srv
and not directly in srv
.
Error: Failed loading service implementation from '/home/vcap/app/srv/<file-name>.js'
See cap/issues#16004
(cannot link it here) for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sidakphull → will fix the root cause instead of having to go such workarounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sidakphull, as you already pointed out, the issues might be due to @source
being set by default.
As I was not able to reproduce the erroneous behaviour, though, may I ask you to do so with this line changed like that, in you local node_modules/@sap/cds/lib/srv/factory.js
:
-- const _source = (d) => d['@source'] || (d['@source'] = d.$location && d.$location.file.replace(/\\/g, '/') || '.')
++ const _source = (d) => d['@source'] || d.$location?.file || '.'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not able to reproduce locally since I don't have the sample application from the issue anymore and it seems to be deleted. Will try again and get back to you regarding this.
→ should discuss that in Jan