U1db.Document silently ignores key assignment

Bug #1465003 reported by Sam Bull
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
u1db-qt (Ubuntu)
Confirmed
Undecided
Unassigned

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.

Sam Bull (dreamsorcerer)
description: updated
Revision history for this message
Cris Dywan (kalikiana) wrote :

This is QVariant, specifically how variants in QML behave, and not deliberate on U1Db's part.

The only way to address this would be to re-consider the API or try to replace QVariant.

affects: ubuntu-ui-toolkit (Ubuntu) → u1db-qt (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in u1db-qt (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.