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

Adds support for msg_id & thread_id #190

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Xotl
Copy link

@Xotl Xotl commented May 27, 2019

Fixes issue #189, #191 & #169.

@Xotl Xotl changed the title Fixes issues #189 & #169 Adds support for msg_id & threa_id May 27, 2019
@Xotl Xotl changed the title Adds support for msg_id & threa_id Adds support for msg_id & thread_id May 27, 2019
@Xotl Xotl mentioned this pull request May 27, 2019
@jtliao
Copy link
Contributor

jtliao commented May 30, 2019

Can you pass in the new params directly instead? The current change may be a bit misleading, and we can pass in default params for threadId and msgId to get around the backwards compatibility issue

Copy link
Contributor

@jtliao jtliao left a comment

Choose a reason for hiding this comment

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

have msgId and threadId as parameters with default values

@Xotl
Copy link
Author

Xotl commented Jun 3, 2019

Having Wit.message() to receive more params it's not maintainable. It just increases the Cyclomatic complexity.

A good approach to solve this problem is to have an object with the params we want.

See issue #189.

@jtliao
Copy link
Contributor

jtliao commented Jun 4, 2019

I would argue the complexity is higher if a single argument takes different forms. I'm not sure how adding two params with default values makes thing not maintainable.

@Xotl
Copy link
Author

Xotl commented Jun 4, 2019

if we pass a single object we can just iterate over the properties of such object instead of adding more if's.

Regarding the maintainability, what will happen if suddenly the /messages endpoint deprecates one field?, let's say verbose gets deprecated... you will be passing null always for that parameter even though it's no longer used.

@Xotl
Copy link
Author

Xotl commented Jun 5, 2019

Updated the PR to show what the implementation look like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants