Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-177

Rewriting a gridStore file by id should use a new filename if provided

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.4
    • Component/s: None
    • Labels:

      In GridStore, if an existing file is opened for write and a valid _id is provided, a provided filename parameter is not used as the filename for the newly written file, even though every other bit of metadata file data can be replaced, significantly including contentType.

      It is unexpected and inconsistent behavior to create a file called stuff.txt with type text/plain and then be able to open it for rewriting as stuff.html with type text/html and have the new filename discarded, but the new content-type retained. This pull request fixes this bug by allowing the rewrite of the file to set a new filename to match the new content-type.

      This commit also fixes an obvious this/self typo bug regarding filename in the same function.

      See attached failing tests.

      Pull request with fix: https://github.com/mongodb/node-mongodb-native/pull/1169

        1. filename.js
          1 kB
        2. filename2.js
          1 kB

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            vsi Vaughn Iverson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: