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

Bug compatible WXCreateChatRoom #1341

Merged
merged 10 commits into from
Jun 15, 2018
Merged

Conversation

lijiarui
Copy link
Member

@huan
Copy link
Member

huan commented Jun 14, 2018

Please test your code and confirm it works as you expected.

I do not believe it does what you want it to.

@huan
Copy link
Member

huan commented Jun 14, 2018

This PR looks better after you commit your new modifications.

I'd like to suggest that we should write a new pure function helper to implement this function, maybe fixWei() in fix-wei.ts is a good name for it, but it's just a suggestion.

And we need to bundle unit tests with the new function, I think there's already two in your comments:

   // BUG compitable: "\n\u00135907139882@chatroom" -> "5907139882@chatroom"
   // BUG compitable: "\n\u001412558026334@chatroom" -> "12558026334@chatroom"
   str.replace(/^\n[\u0000-\uffff]/g, '')

@lijiarui
Copy link
Member Author

lijiarui commented Jun 14, 2018

Good suggestion!

And I suggest:

  • filename: compatible-wei.ts
  • function: pureUserName()

@huan
Copy link
Member

huan commented Jun 14, 2018

Ok.

I'll merge this PR after you finished it.

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

Awesome. Please follow my suggestions before I merge it.

@@ -24,3 +24,4 @@ export * from './room-event-leave-message-parser'
export * from './room-event-topic-message-parser'
export * from './room-raw-payload-parser'
export * from './split-name'
export * from './compatible-wei'
Copy link
Member

Choose a reason for hiding this comment

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

Please modify the export files list in order: by filename.

* BUG compitable: "\n\u00135907139882@chatroom" -> "5907139882@chatroom"
* BUG compitable: "\n\u001412558026334@chatroom" -> "12558026334@chatroom"
*/
export function pureUserName(id?: string) {
Copy link
Member

Choose a reason for hiding this comment

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

pureUserName -> stripBugWei

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe not stripBugWei , because I'm sure it will have more bug in the future...

Copy link
Member

@huan huan left a comment

Choose a reason for hiding this comment

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

rename then we can merge.

@@ -12,6 +12,7 @@
*
*/

export * from './compatible-wei'
Copy link
Member

Choose a reason for hiding this comment

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

compatible-wei -> compatible-wei-bug

Copy link
Member

Choose a reason for hiding this comment

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

This rename is required because that we compatible with wei because it has BUG.

Copy link
Member Author

Choose a reason for hiding this comment

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

you are right, done

@huan huan merged commit 0323124 into wechaty:master Jun 15, 2018
@lijiarui lijiarui deleted the bug-compatible-createroom branch July 30, 2018 15:39
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