boardgameio / boardgame.io

State Management and Multiplayer Networking for Turn-Based Games
https://boardgame.io
MIT License
10.03k stars 709 forks source link

Release v0.41.1 of boardgame.io broke the usage of bgio-storage-cache #830

Closed evandroabukamel closed 4 years ago

evandroabukamel commented 4 years ago

I'm just testing some stuff with the new release of boardgame.io and I noticed an error on match creation by bgio-storage-cache. This is related with the change I worked on about game/match consistency. My fault, I forgot about this lib.

Should have to create the deprecated methods on the derived classes too, Flatfile and InMemory?

Using the deprecated createGame method instead.

  TypeError: this.db.createGame is not a function
      at StorageCache.<anonymous> (./node_modules/bgio-storage-cache/dist/bgio-storage-cache.js:69:27)
delucis commented 4 years ago

Yes, patching this in the derived classes while the methods are deprecated rather than removed seems like it might be a good idea. Something like:

class Impl extends Async {
  // ...

  /**
   * @deprecated Use createMatch instead.
   */
  createGame(matchID: string, opts: CreateMatchOpts) {
    return this.createMatch(matchID, opts);
  }
}
delucis commented 4 years ago

@evandroabukamel Actually, after consideration, I think this should be fixed in https://github.com/delucis/bgio-storage-cache/issues/3FlatFile and InMemory only need to be compatible with the current version of boardgame.io. The storage cache special case should be updated there.

evandroabukamel commented 4 years ago

Alright, thanks.