Opened 10 years ago

Last modified 10 years ago

#927 closed defect

Clean up Federation — at Version 2

Reported by: Jessica Tallon Owned by:
Priority: critical Milestone: 0.7.0
Component: programming Keywords:
Cc: Parent Tickets:

Description (last modified by Elrond)

Elrond found some issues over his review of the federation code recently merged. These need fixing before 0.7.0.

Garbage Collection

  • This task should be moved to submit
  • This task uses the wrong operator in garbage collection (greater than rather than less then)
  • The test sets entry.uploaded not entry.created ergo doesn't do anything.
  • Logging is wrong.
  • Use spaces not tabs! (WTF jess).

Feed Endpoint

  • The comment is wrong (should say list all media not the users media).

Whoami Endpoint

  • Doesn't handle the case where I might not be logged in

MediaComment.unserialize

  • Needs to do more checking that all the data I want to look up in the dictionary exists to avoid KeyErrors.

Mediagoblin INI/Config file

  • Should remove garbage_collection setting to spec file and remove it from mediagoblin.ini as it won't be commonly set.

json_error

  • On the idea of:
    def json_error(error_str, status=400):
        return json_response({"error": error_str}, status=status)
    
  • I am not sure, where to put this, either in the general response place, where json_response is also, or maybe only where it's being used in the federation code. If I have to vote, I'd likely vote for the former.

If any more issues are found please add them to this ticket. This is a rather large issue but most of the tasks in them are so small it doesn't warrant splitting them up.

Change History (2)

comment:1 by Elrond, 10 years ago

Description: modified (diff)

Add json_error idea.

comment:2 by Elrond, 10 years ago

Description: modified (diff)

Fix Cut'n'paste issue. Add placement comment.

Note: See TracTickets for help on using tickets.