Skip to content

Commit

Permalink
feat(apps): add user param to update app call (#32719)
Browse files Browse the repository at this point in the history
Co-authored-by: Douglas Gubert <[email protected]>
  • Loading branch information
KevLehman and d-gubert authored Jul 17, 2024
1 parent bed824f commit b8e5887
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
13 changes: 13 additions & 0 deletions .changeset/witty-bats-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@rocket.chat/meteor": patch
"@rocket.chat/apps": patch
"@rocket.chat/core-services": patch
"@rocket.chat/core-typings": patch
"@rocket.chat/fuselage-ui-kit": patch
"@rocket.chat/rest-typings": patch
"@rocket.chat/ddp-streamer": patch
"@rocket.chat/presence": patch
"rocketchat-services": patch
---

Added the `user` param to apps-engine update method call, allowing apps' new `onUpdate` hook to know who triggered the update.
7 changes: 6 additions & 1 deletion apps/meteor/ee/server/apps/communication/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,12 @@ export class AppsRestApi {
return API.v1.internalError('private_app_install_disabled');
}

const aff = await manager.update(buff, permissionsGranted);
const user = orchestrator
?.getConverters()
?.get('users')
?.convertToApp(await Meteor.userAsync());

const aff = await manager.update(buff, permissionsGranted, { user, loadApp: true });
const info: IAppInfo & { status?: AppStatus } = aff.getAppInfo();

if (aff.hasStorageError()) {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8510,8 +8510,8 @@ __metadata:
linkType: soft

"@rocket.chat/apps-engine@npm:alpha":
version: 1.44.0-alpha.814
resolution: "@rocket.chat/apps-engine@npm:1.44.0-alpha.814"
version: 1.44.0-alpha.818
resolution: "@rocket.chat/apps-engine@npm:1.44.0-alpha.818"
dependencies:
"@msgpack/msgpack": 3.0.0-beta2
adm-zip: ^0.5.9
Expand All @@ -8527,7 +8527,7 @@ __metadata:
uuid: ~8.3.2
peerDependencies:
"@rocket.chat/ui-kit": "*"
checksum: 03f777ecd035af20c88558a941db77bb104f4402f78169a6d23e1629613c11ac23c04f6bdfb451a4273558789de58d4567661a7bd5de91b78464f98698e5f6a6
checksum: acef47bc7f13e0682d018531638b5168c3acd59beae37b013e881ea6fadfe12670fe10545f4a89487f7bedbe9166028833cba7ed3fc401d4283327e47e00e61c
languageName: node
linkType: hard

Expand Down

0 comments on commit b8e5887

Please sign in to comment.