Add comments pointing to github issue

This commit is contained in:
Shane Kilkelly 2019-01-09 14:24:04 +00:00
parent b8d252244c
commit 4f1168a590
2 changed files with 6 additions and 0 deletions

View file

@ -97,6 +97,9 @@ public class SnapshotApiFacade {
= api.getSavedVers(oauth2, projectName); = api.getSavedVers(oauth2, projectName);
GetDocResult latestDoc = SnapshotApi.getResult(getDoc); GetDocResult latestDoc = SnapshotApi.getResult(getDoc);
int latest = latestDoc.getVersionID(); int latest = latestDoc.getVersionID();
// Handle edge-case for projects with no changes, that were imported
// to v2. In which case both `latest` and `version` will be zero.
// See: https://github.com/overleaf/writelatex-git-bridge/pull/50
if (latest > version || (latest == 0 && version == 0)) { if (latest > version || (latest == 0 && version == 0)) {
for ( for (
SnapshotInfo snapshotInfo : SnapshotInfo snapshotInfo :

View file

@ -98,6 +98,9 @@ public class GetDocResult extends Result {
} }
} else { } else {
versionID = jsonObject.get("latestVerId").getAsInt(); versionID = jsonObject.get("latestVerId").getAsInt();
// Handle edge-case for projects with no changes, that were imported
// to v2. In which case `latestVerAt` will not be present.
// See: https://github.com/overleaf/writelatex-git-bridge/pull/50
if (jsonObject.has("latestVerAt")) { if (jsonObject.has("latestVerAt")) {
createdAt = jsonObject.get("latestVerAt").getAsString(); createdAt = jsonObject.get("latestVerAt").getAsString();
} else { } else {