async addToServer(entry) {
    return new Promise(async (resolve, reject) => {
      const lastEntryNumber = await this.getLastEntryNumber_(entry.workspaceId);
      if (entry.entryNumber > lastEntryNumber) {
        try {
          const serverId = await this.runInsertQuery_(entry);
          await this.updateLastEntryNumber_(
            entry.workspaceId,
            entry.entryNumber,
          );
          resolve(serverId);
        } catch {
          reject('Failed to write to the database');
        }
      } else if (entry.entryNumber == lastEntryNumber) {
        resolve(null);
      } else {
        reject('Entry is not valid.');
      }
    });
  }
Add entry to the database if the entry is a valid next addition.
For each user, an addition is valid if the entryNumber is greater than the
entryNumber of its last added entry.
@param {!LocalEntry} entry The entry to be added to the database.
@returns {!Promise} Promise object with the serverId of the entry written to
the database.
@public