GraiaProject / Avilla

The next-gen framework for IM development. Powered by Graia Project.
MIT License
160 stars 14 forks source link

feat(onebot): caching metadata #172

Open nullqwertyuiop opened 3 months ago

nullqwertyuiop commented 3 months ago

Receiving: tested on Lagrange.Onebot (aa7ca60)

Known Issue:

  1. Selector and ContextClientSelector

    - nick: Nick = await ctx.pull(Nick, ctx.client)
    + nick: Nick = await ctx.pull(Nick, Selector(ctx.client.pattern))

    The type of former is ContextClientSelector while the type of cache keys in context.cache is Selector. When pulling, this line returns None resulting cached metadata not being hit.

  2. Undesired results

    This line should return a non-empty badge running in my environment, but in my testing it returns "". According to OneBot 11 Standard Docs it should work in theory but I'm having no other capable implementations. Further tests may be needed.