Closed Bug 864978 Opened 13 years ago Closed 13 years ago

Should updatedAt and createdAt always be generated by the MakeAPI instead of passed in?

Categories

(Webmaker Graveyard :: MakeAPI, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: kate, Assigned: mjschranz)

Details

I don't think we should allow individual apps to set createdAt or updatedAt when creating makes. When a user visits a page on webmaker.org that sorts makes by "most recent", the user should always see makes sorted relative to each other, not whatever date/time the original app has assigned them. Additionally, we shouldn't allow a situation in which an app could set an arbitrarily high date to always push makes to the top. What do you guys think?
Flags: needinfo?(david.humphrey)
I think it's sane to say that these dates are when the thing entered the MakeAPI index, yeah. Have the MakeAPI handle it. You might also want to add an authoredDate, which is optional, and could default to createdAt if not given, but could also represent a date external to our stuff. This is often done for archiving.
Flags: needinfo?(david.humphrey)
Summary: Should updatedAt and createdAt be always be generated by the MakeAPI instead of passed in? → Should updatedAt and createdAt always be generated by the MakeAPI instead of passed in?
I agree with Dave, it's good form to let the API handle those fields. I think the idea of an authoredDate could be useful to lots of apps. i.e. Work started on this Make on Date X but it wasn't published until Date Y
Sounds fine to me. Likely not something that would surface often in our UI but nothing wrong with having it I guess
Based on the discussions I had with :humphd about how we are going to want to handle Makes around Events in the future, adding in the extra field isn't needed. At this point, updatedAt and createdAt can't be set on initial creation and can be updated afterwards. Going to close this bug as WORKSFORME.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → WORKSFORME
Correction, neither values are can be set by callers of the API. createdAt always stays the same and updatedAt is set by the API as updates are made. Same with deletedAt.
You need to log in before you can comment on or make changes to this bug.