Просмотр исходного кода

Add comments pointing to github issue

Shane Kilkelly 7 лет назад
Родитель
Сommit
4f1168a590

+ 3 - 0
services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/snapshot/SnapshotApiFacade.java

@@ -97,6 +97,9 @@ public class SnapshotApiFacade {
                 = api.getSavedVers(oauth2, projectName);
         GetDocResult latestDoc = SnapshotApi.getResult(getDoc);
         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)) {
             for (
                     SnapshotInfo snapshotInfo :

+ 3 - 0
services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/GetDocResult.java

@@ -98,6 +98,9 @@ public class GetDocResult extends Result {
             }
         } else {
             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")) {
                 createdAt = jsonObject.get("latestVerAt").getAsString();
             } else {