google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.47k stars 3.71k forks source link

Variables and procedures have IDs in saved XML. #2636

Open NeilFraser opened 5 years ago

NeilFraser commented 5 years ago

The XML used by the storage.js component contains IDs for each variable. E.g.

<xml>
  <variables>
    <variable id="}Q9|,=*ol9x}Qr)3BMW3" type="">foo</variable>
...

Theoretically this ID might pose some some privacy issues. Ideally if two people create the same program, they should get the same XML. Can we drop these IDs from saved XML?

(Please keep discussion in this bug focused on engineering, and not speculate on any legal arguments.)

BeksOmega commented 5 years ago

I know this is used with the procedure arguments, I'm not sure if it's necessary though.

XML:

<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable type="" id="9|!4-M.jZ-[PUIu:cXd(">x</variable>
  </variables>
  <block type="procedures_defnoreturn">
    <mutation>
      <arg name="x" varid="9|!4-M.jZ-[PUIu:cXd("/>
    </mutation>
    <field name="NAME">do something</field>
  </block>
</xml>

domToMutation

getOrCreateVariablePackage

RoboErikG commented 5 years ago

I'd prefer to keep them in the standard save format for a few reasons:

rachel-fenichel commented 5 years ago

At minimum, any changes around this should not be in this week's release.

RoboErikG commented 5 years ago

I believe we landed on propagating opt_stripId through to all of the bits that include an id (variables, blocks, and shadows). It looks like it's correct for blocks and shadows, but I'm not sure if variables have been fixed yet.