← Back to team overview

ubuntu-sdk-bugs team mailing list archive

[Bug 1465003] [NEW] U1db.Document silently ignores key assignment

 

Public bug reported:

"document.contents[foo] = bar" has no effect.

This results in needing to write the above code as:
  var temp = document.contents
  temp[foo] = bar
  document.contents = temp

This is annoying and ugly code everytime I want to update a single
value.

Proposed solution:
  Allow saving keys directly.

  If for some reason this is absolutely not possible, atleast throw an
error or display a warning when an assignment is attempted, as it is
clearly not the desired behaviour that the above line of code does
absolutely nothing.

** Affects: ubuntu-ui-toolkit (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  "document.contents[foo] = bar" has no effect.
  
  This results in needing to write the above code as:
-   var temp = document.contents
-   temp[foo] = bar
-   document.contents = temp
+   var temp = document.contents
+   temp[foo] = bar
+   document.contents = temp
  
- This is annoying and not nice code everytime I want to update a single
+ This is annoying and ugly code everytime I want to update a single
  value.
  
  Proposed solution:
-   Allow saving keys directly.
+   Allow saving keys directly.
  
-   If for some reason this is absolutely not possible, atleast throw an
- error or display or warning when an assignment is attempted, as it is
+   If for some reason this is absolutely not possible, atleast throw an
+ error or display a warning when an assignment is attempted, as it is
  clearly not the desired behaviour that the above line of code does
  absolutely nothing.

-- 
You received this bug notification because you are a member of Ubuntu
SDK bug tracking, which is subscribed to ubuntu-ui-toolkit in Ubuntu.
https://bugs.launchpad.net/bugs/1465003

Title:
  U1db.Document silently ignores key assignment

Status in ubuntu-ui-toolkit package in Ubuntu:
  New

Bug description:
  "document.contents[foo] = bar" has no effect.

  This results in needing to write the above code as:
    var temp = document.contents
    temp[foo] = bar
    document.contents = temp

  This is annoying and ugly code everytime I want to update a single
  value.

  Proposed solution:
    Allow saving keys directly.

    If for some reason this is absolutely not possible, atleast throw an
  error or display a warning when an assignment is attempted, as it is
  clearly not the desired behaviour that the above line of code does
  absolutely nothing.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-ui-toolkit/+bug/1465003/+subscriptions


Follow ups

References