10.10 milestone name corrupted in JS: 10.1

Bug #581748 reported by Matthew Revell on 2010-05-17
86
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Low
Colin Watson
lazr.restful
High
Unassigned

Bug Description

Steps to reproduce:

1. In a series of a Launchpad sub-project (e.g. malone) create a milestone named 10.10.
2. Notice the error message "Could not retrieve milestone 10.10" in the Milestones and Releases table.
3. Refresh and the error becomes a link to a new 10.1 milestone, rather than 10.10.

See screen shot.

Related branches

Matthew Revell (matthew.revell) wrote :
Curtis Hovey (sinzui) wrote :

Looks like the trailing '0' is lost between ajax and the form. The milestone is created as 10.1, which causes the error. The user can then rename the milestone. It is possible for this problem to create another error is the x.1 milestone already exists.

Changed in launchpad-registry:
importance: Undecided → Low
status: New → Triaged
milestone: none → series-future
Curtis Hovey (sinzui) wrote :

The problem is type conversion. Code names are strings, "10.10" is a string, but JS thinks it is a float, so it drops the 0.
maybe milestoneoverlay.js can do the string concatenation hack to ensure version is alwaysa string
    code_name: data['field.code_name'][0],
should be
    code_name: '' + data['field.code_name'][0],

Curtis Hovey (sinzui) on 2010-11-02
summary: - Can't create 10.10 milestone for Launchpad sub
+ 10.10 milestone name corrupted in JS: 10.1
tags: added: javascript
Curtis Hovey (sinzui) on 2011-09-27
tags: added: milestones
Barry Warsaw (barry) wrote :

It's kind of icky, but I guess we'll just have to skip X.10 version numbers. I suppose this affects all X.Y0 versions.

Marc Deslauriers (mdeslaur) wrote :

FYI, I believe I worked around this issue by adding quotes when I entered the version number.

On Oct 09, 2013, at 03:53 PM, Marc Deslauriers wrote:

>FYI, I believe I worked around this issue by adding quotes when I
>entered the version number.

Indeed!

You'll get an error saying `Couldn't retrieve milestone "1.10"` but if you
refresh the page, the milestone sans quotes will be there just fine.

Thanks for the workaround.

Curtis Hovey (sinzui) wrote :

I had contemplated an alternate workaround on the backend. The script
will append "~~" and the backend always strips ~~.

William Grant (wgrant) wrote :

Or you can just middle-click the "Create milestone" link to navigate to the non-AJAX form, which isn't affected by the JS bug.

William Grant (wgrant) wrote :

The misbehaviour is caused by lazr.restful's SimpleFieldMarshaller.marshall_from_request. It attempts to decode the form value as JSON, using it as a string only if the parsing fails. We probably want to avoid that decoding if we know we're looking for a string and not some other kind of object.

Changed in lazr.restful:
importance: Undecided → High
status: New → Triaged
Colin Watson (cjwatson) on 2015-10-13
Changed in launchpad:
assignee: nobody → Colin Watson (cjwatson)
status: Triaged → In Progress
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Colin Watson (cjwatson) on 2015-10-13
tags: added: qa-ok
removed: qa-needstesting
Colin Watson (cjwatson) on 2015-10-21
Changed in launchpad:
status: Fix Committed → Fix Released
Colin Watson (cjwatson) wrote :

This had to be rolled back a couple of times due to breaking other bits of JS and has now been reverted from trunk, so we'll need to fix those up and QA more thoroughly before re-landing this.

Changed in launchpad:
status: Fix Released → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions