Closed Bug 955677 Opened 11 years ago Closed 11 years ago

Nick truncated if already in use during connection registration

Categories

(Chat Core :: IRC, defect)

x86
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: florian, Assigned: clokep)

References

()

Details

Attachments

(1 file, 2 obsolete files)

*** Original post on bio 2229 at 2013-10-24 16:02:00 UTC *** clokep told me to file a bug ;)
Summary: Nick flo-retina changed to flo-reti1 if flo-retina was in used → Nick flo-retina changed to flo-reti1 if flo-retina was in use
We fallback to the default maximum length of an IRC nick (8 characters) if we're told a nick is invalid during connection registration (I don't think we're told WHY it is, just that it is). E.g. "flo-retina changed to flo-reti1 if flo-retina was in use".
Summary: Nick flo-retina changed to flo-reti1 if flo-retina was in use → Nick truncated if already in use during connection registration
Attached patch Patch v1 (obsolete) — Splinter Review
This changes from trying to anticipate when we'd send too long of a nick to just sending one and seeing when the nick returned to us is shorter than the nick that we sent.
Assignee: nobody → clokep
Status: NEW → ASSIGNED
Attachment #8474141 - Flags: review?(aleth)
Comment on attachment 8474141 [details] [diff] [review] Patch v1 Review of attachment 8474141 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for fixing this! I'm glad this has tests already. ::: chat/protocols/irc/irc.js @@ +1235,5 @@ > + // nickname with the returned nickname and check for truncation. > + if (aOldNick.length < this._sentNickname.length) { > + // The nick will be too long, overwrite the end of the nick instead of > + // appending. > + print("FOOBAR"); Possibly, but I suspect all these prints are superfluous to requirements ;) ::: chat/protocols/irc/test/test_tryNewNick.js @@ +50,5 @@ > +} > + > +// This tests a bunch of cases near the max length by maintaining the state > +// through a series of test nicks. > +function test_maxLength() { I don't think this test is being run, which is a good way to make it pass.
Attachment #8474141 - Flags: review?(aleth) → review-
Attached patch Patch v2 (obsolete) — Splinter Review
I had to modify the tests a bit to pass, but I'm fairly certain they were mistakes in the tests though. Please make sure the tests make sense!
Attachment #8474141 - Attachment is obsolete: true
Attachment #8475620 - Flags: review?(aleth)
Comment on attachment 8475620 [details] [diff] [review] Patch v2 Review of attachment 8475620 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! ::: chat/protocols/irc/test/test_tryNewNick.js @@ +28,5 @@ > "clo1kep01": "clo1kep02", > "clo1kep09": "clo1kep10", > > // Some to test the max length. > + //"abcdefgh9": "abcdefgh10", With a maxlength of 9, naively this should not work. Comment? Or are these obsolete now due to the separate test?
Attachment #8475620 - Flags: review?(aleth) → review+
Attached patch Patch v2.1Splinter Review
Correct, those tests were replaced. Forgot to remove them, sorry!
Attachment #8475620 - Attachment is obsolete: true
Attachment #8475832 - Flags: review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: