[tahoe-lafs-trac-stream] [tahoe-lafs] #1079: upload of file into dir doesn't appear on Recent Uploads and Downloads

tahoe-lafs trac at tahoe-lafs.org
Tue Aug 9 10:44:12 PDT 2011


#1079: upload of file into dir doesn't appear on Recent Uploads and Downloads
-------------------------+-------------------------------------------------
     Reporter:  zooko    |      Owner:
         Type:  defect   |     Status:  new
     Priority:  major    |  Milestone:  1.9.0
    Component:  code-    |    Version:  1.7β
  frontend               |   Keywords:  upload usability statistics wui
   Resolution:           |  easy
Launchpad Bug:           |
-------------------------+-------------------------------------------------

Comment (by warner):

 I did some digging. The problem is that we aren't being consistent in
 passing the "History" object to all cases of file upload. (to get into
 the "Recent Uploads and Downloads" RUaD page, the Uploader must be given
 access to the History object, so it can call {{{History.add_upload}}}).

 {{{Client.upload(uploadable)}}} does the right thing. The webapi has
 several different code paths that result in an immutable upload:

  * PUT /uri : hits {{{PUTUnlinkedCHK}}} (unlinked.py#L11) which calls
    {{{client.upload}}}, ok
  * PUT /uri/DIRCAP/childname: hits filenode.py#L37 which calls
    {{{self.parentnode.add_file()}}}, which does *not* handle history
  * POST /uri/DIRCAP/newchildname?t=upload and POST
    /uri/DIRCAP/oldchildname?t=upload&replace=true : both hit
    {{{replace_me_with_a_formpost}}} (filenode.py#L86), uses
    {{{self.parentnode.add_file()}}}, *no* history

 The root problem is that {{{DirectoryNode.add_file()}}}, while
 convenient, doesn't have access to the History object. The best fix is
 probably to delete this method, and rewrite web/filenode.py to make two
 separate calls: {{{client.upload}}} and {{{self.parentnode.set_uri}}}.

 OTOH, {{{add_file()}}} is used in an awful lot of unit tests, because
 it's so darned convenient. It'd be easier to change
 {{{DirectoryNode.add_file}}} to use {{{client.upload}}}, since the
 client knows about {{{History}}}, but {{{DirectoryNode}}} doesn't
 currently hold a reference to the client (just the nodemaker and the
 uploader). Maybe we should move {{{client.upload}}} over to the
 nodemaker?

-- 
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1079#comment:3>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list