invalid date issue with github mixin
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- git, github, javascript
- Domain
- api
Research direction
Start in jsgit.js at repo.saveAs and trace the GitHub mixin's author date through encodePerson to encodeDate. Compare the JavaScript Date value with the date shape expected by encodeDate, then verify that a fix allows GitHub commits to be written without breaking other date inputs.
Written by the indexing model from the issue text.
Description
When invoking repo.saveAs for a new commit using the github mixin, the date value handed to the author object (and supplied to encodePerson and ultimately encodeDate in jsgit.js) is expected to be an object with fields like "offset" and "seconds", but is actually a Javascript Date object. This causes "invalid date" errors to be thrown by encodeDate and prevents commits from being written to GitHub.
I've "fixed" this for my own GitHub-centric use-case by simply hacking encodePerson to use the Date object's toISOString(), bypassing encodeDate -- see the small change in my fork here:
https://github.com/musicog/js-git-browser/blob/fix-date-issue/jsgit.js#L10005
However I appreciate this might well break non-GitHub-centric use-cases. Perhaps you have an idea of how to fix this properly?
Many thanks for the helpful module!
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·