Code Monkey home page Code Monkey logo

archivist's People

Contributors

emptyrivers avatar lwafaure avatar meorawr avatar stanzilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

archivist's Issues

Error with /wa repair

Using your branch from WeakAuras/WeakAuras2#2067
When typing /wa repair i get this error

1x WeakAuras\Libs\Archivist\Archivist.lua:555: Encountered unexpected token type while parsing object. Expected "KEY" but got "VALUE".
[string "=[C]"]: in function `error'
[string "@WeakAuras\Libs\Archivist\Archivist.lua"]:53: in function `Assert'
[string "@WeakAuras\Libs\Archivist\Archivist.lua"]:555: in function <WeakAuras\Libs\Archivist\Archivist.lua:533>
[string "@WeakAuras\Libs\Archivist\Archivist.lua"]:574: in function `DeArchive'
[string "@WeakAuras\Libs\Archivist\Archivist.lua"]:299: in function <WeakAuras\Libs\Archivist\Archivist.lua:290>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "@WeakAuras\ArchiveTypes\Repository.lua"]:56: in function <WeakAuras\ArchiveTypes\Repository.lua:52>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "@WeakAuras\WeakAuras-@[email protected]"]:2824: in function <WeakAuras\WeakAuras.lua:2818>

SavedVariables.zip

DeleteAll with store type breaks Archivist for rest of session

self.sv[storeType] = nil

The current implementation of the Archivist:DeleteAll(storeType) function nils out the named store table in self.sv when a store type is explicitly passed. This leads to the rest of Archivist breaking if you then call other functions for the store type that was just deleted.

If called without an explicit store type the self.sv entries for each store type aren't nilled out and are instead replaced with empty tables, leaving Archivist functioning fine when other functions are called.

Very basic test case:

Archivist:Initialize({});
print(Archivist.sv.ReadOnly);
Archivist:DeleteAll("ReadOnly");
print(Archivist.sv.ReadOnly);
Archivist:Create("ReadOnly", "TestStore", ":)");  -- Error! :(
print(Archivist.sv.ReadOnly.TestStore);

This will throw the following error once it calls the Create function:

4x SecretProject\Libs\Archivist\Archivist.lua:200: attempt to index field '?' (a nil value)
[string "@SecretProject\Libs\Archivist\Archivist.lua"]:200: in function `Create'

Compared to the alternative of not passing a store name, no error occurs:

Archivist:Initialize({});
print(Archivist.sv.ReadOnly);
Archivist:DeleteAll();
print(Archivist.sv.ReadOnly);
Archivist:Create("ReadOnly", "TestStore", ":)");
print(Archivist.sv.ReadOnly.TestStore);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.