Skip to content
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

[FIX] Integrations with room data not having the usernames filled in #10576

Merged
merged 2 commits into from
Apr 26, 2018

Conversation

graywolf336
Copy link
Contributor

Closes #10416

Also, this fixes an issue happening inside of Zapier.

Basically we are writing to history and doing it by reference then updating the reference of the rooms. So, we are now cloning the data going onto history due to us adjusting the data stored three.

cc: @mrsimpson

@engelgabriel engelgabriel temporarily deployed to rocket-chat-pr-10576 April 24, 2018 21:59 Inactive
@graywolf336 graywolf336 added this to the 0.64.0 milestone Apr 24, 2018
@@ -84,7 +84,7 @@ RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler
}

if (data) {
history.data = data;
history.data = { ...data };
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, this does not work as you expect it to work. So, we need to revert this change:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graywolf336 the _clone doesn't do the same? Copying only the first level of the object?

@graywolf336
Copy link
Contributor Author

Used the VSCode debugger to determine which one works on the server.

Here is one with the _.clone(data):
image

And here's with the { ...data }:
image

So, I would guess that it works because of how the polyfill for the object spread works. Some reason there is a different in the web/chrome without the polyfill.

@sampaiodiego
Copy link
Member

sampaiodiego commented Apr 25, 2018

I don't know what to do.. lol

even underscore docs says _.clone should not work:

Create a shallow-copied clone of the provided plain object. Any nested objects or arrays will be copied by reference, not duplicated.

@graywolf336 graywolf336 merged commit 75d69f0 into develop Apr 26, 2018
@graywolf336 graywolf336 deleted the fix/integrations-room branch April 26, 2018 14:31
mrsimpson added a commit to assistify/Rocket.Chat that referenced this pull request Apr 27, 2018
@rodrigok rodrigok mentioned this pull request Apr 28, 2018
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request May 2, 2018
* develop:
  Regression: Various search provider fixes (RocketChat#10591)
  Fix /api/v1/settings.oauth not sending needed info for SAML & CAS (RocketChat#10596)
  Fix the Apps and Livechats not getting along well with each other (RocketChat#10598)
  [FIX] Missing "Administration" menu for users with some administration permissions (RocketChat#10551)
  [FIX] Member list search with no results (RocketChat#10599)
  Adds Visual Studio Code debugging configuration (RocketChat#10586)
  [FIX] Integrations with room data not having the usernames filled in (RocketChat#10576)
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request May 2, 2018
* goalify: (104 commits)
  Regression: Various search provider fixes (RocketChat#10591)
  Supplement TOS and privacy policy texts for use within server instances
  Fix /api/v1/settings.oauth not sending needed info for SAML & CAS (RocketChat#10596)
  Fix the Apps and Livechats not getting along well with each other (RocketChat#10598)
  [FIX] Missing "Administration" menu for users with some administration permissions (RocketChat#10551)
  [FIX] Member list search with no results (RocketChat#10599)
  merge vi-VN and vi json
  Add and enhance translations
  Update gitlab, npm package lock, include current server update script
  Adds Visual Studio Code debugging configuration (RocketChat#10586)
  [FIX] Integrations with room data not having the usernames filled in (RocketChat#10576)
  fixed problems with margin negative (RocketChat#10558)
  Add some information regarding Zapier and Bots to the integrations page (RocketChat#10574)
  Added target="_blank" to homepage and support link. (RocketChat#10575)
  [FIX] Stop Firefox announcement overflowing viewport (RocketChat#10503)
  [FIX] Wordpress oAuth authentication wasn't behaving correctly (RocketChat#10550)
  Fix inconsistent response of settings.oauth endpoint (RocketChat#10553)
  Regression: Remove added mentions on quote/reply (RocketChat#10571)
  Fix the attachments and fields incorrectly failing on validation (RocketChat#10573)
  Deps update (RocketChat#10549)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Usernames in Request at Outgoing Webhook for Direct Messages
5 participants