DELETE doesn't remove vector representation in ES

When adding and removing things to a Weaviate, the following query:
{
  Local{
    Get{
      Things{
        Book(explore:{
          concepts: ["derek", "hartfield"]
        }){
          title
          HasAuthors{
            ... on Author{
              name
            }
          }
        }
      }
    }
  }
}

results in:
{
  "data": {
    "Local": {
      "Get": {
        "Things": {
          "Book": [
            null,
            {
              "HasAuthors": null,
              "title": "Watchmen"
            },
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            {
              "HasAuthors": null,
              "title": "Alice in Wonderland"
            },
            null,
            null,
            {
              "HasAuthors": null,
              "title": "The Corrections "
            },
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            {
              "HasAuthors": null,
              "title": "The Sandman"
            },
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            {
              "HasAuthors": null,
              "title": "Pinball in 1987"
            }
          ]
        }
      }
    }
  },
  "errors": null
}

I'm pretty sure the reason for this is that a DELETE /things/{thingId} doesn't remove the vector representation.

Note, I just removed all things. The result of the above query now is:
{
  "data": {
    "Local": {
      "Get": {
        "Things": {
          "Book": [
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null,
            null
          ]
        }
      }
    }
  },
  "errors": null
}

Technically this duplicates #910, but I'm keeping it as a separate one now, so that I can priortize only deletion without prioritizing the other missing verbs. This is has now moved to the front of the queue.

Removed the bug label, as a not-yet implemented feature is not a bug.

@bobvanluijt deleting vector entries on DELETE /things and DELETE /actions is now available in this pre-release: https://github.com/semi-technologies/weaviate/blob/a378710ef8fd70459ce528ad8522c6cf516ba3a6/docker-compose/runtime/docker-compose.yml#L10

W00T!


strange error

Never mind I just realized it's because I'm not authenticated in your database ;)

But the config.env shouldn't be on github... ;)

We get such issues a lot. It's good that you corrected you authentication. Please close the issue. @MynahMarie


Bypass link clicks

Sometimes relative links need to be handled like usual in JS apps, like when logging in. A pattern I've used to get this functionality is to add a data-bypass boolean attr to my links to indicate that it should be bypassed.
Is this something you're interested in adding to sheet-router directly, or nah? nbd either way – just figured I'd ask the Q.

Hey there, thanks for opening this issue. Do you have a concrete example? I'm having trouble coming up with cases where this is strictly necessary. Thanks!

Sure - Ill elaborate on the user logins I mentioned above. With Passport + OAuth2, the handling is done server-side, so a hard page load needs to be done against a particular URL, such as /login/google.
Here's an example app with Passport + FB login. Although it's not a SPA, the endpoint for logging in works the same even if it were.

Ah yeah, this definitely makes sense. I reckon it should probably be part of href.js as it relates to handling links.

For reference ,In page.js they ignore:

Links that are not of the same origin
Links with the download attribute
Links with the target attribute
Links with the rel="external" attribute
http://visionmedia.github.io/page.js/

@dcorb I quite like that hey

Default behavior is definitely a good idea, too. I included some default behavior in Backbone.Intercept (an analogous thing for the BB world). Other ideas for things to ignore could be:

mailto protocol
js protocol
page fragments (for apps using pushstate)

Perhaps the idea of default behavior should be a separate issue? I still think the ability to opt-out on a per-link basis is separately important. App requirements can be weird, and it's a bummer to have to turn off this entire feature for a single link that doesn't fit the default behavior, ya know?

Alright then, so to sum up the stuff we should not trigger an href on:

Links that are not of the same origin
Links with the download attribute
Links with the target attribute
Links with the rel="external" attribute
Hash links on the same page (document.querySelector("[href='href_value']"))
Mailto protocol
Js protocol
Page fragments (for apps using pushstate)

Adtionally we should also be able to flag links explicitely, for example by setting:
<a href="/foo/bar" data-router="false">
  my cool link
</a>
```
Or something similar; let me know what you think.

Sounds good to me, @yoshuawuyts .
I just read over the README of Intercept to see if I missed anything, and two things came up. The first is intercepting form submissions that don't have an "action" attribute set.
The second is that I provided options to change the behavior of forms and links independently at start up. This could maybe be useful, but less so than everything else mentioned, I think 👌


393 fixing light disposal and night time adjusts

Overview

Sets night time to be 8pm in game now
Fixes removal of lights using dispose() method
Changes day/night brightness based on time

Closes #393

Trusting remove does the what was intended but assume you tested

Tested with your fireflies and hopefully box2dlights does what it says it does


Add news and change camoscio logo

👷 Deploy Preview for gladia processing.

Name
Link

🔨 Latest commit
f94610929ee7051caaea9a84b8c5326f6bc2b1f2

🔍 Latest deploy log
https://app.netlify.com/sites/gladia/deploys/642aebc8ef81f20008bc03be


settings: Make INVITATION_LINK_VALIDITY_MINUTES optional.

Type inference does not work well when the default value of REQ is
non-optional while ResultT is optional. Mypy tries to unify
json_validator with Validator[int] in invite_users_backend instead
of the desired Validator[Optional[int]] because of the presence of the
default value settings.INVITATION_LINK_VALIDITY_MINUTES, which is
inferred to be an int.
There might be a way that we can add an overload to get around this, but
it's probably not worth the complexity until it comes up again more frequently.
We do in fact allow invite_expires_in_minutes to be None in places
like do_invite_users, invite_users_backend, etc, and we have
settings.INVITATION_LINK_VALIDITY_MINUTES as the default for them. So
it makes sense to allow having an optional value for this setting.
Self-review checklist

[ ] Self-reviewed the changes for clarity and maintainability
(variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

[ ] Explains differences from previous plans (e.g., issue description).
[ ] Highlights technical choices and bugs encountered.
[ ] Calls out remaining decisions and concerns.
[ ] Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

[ ] Each commit is a coherent idea.
[ ] Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

[ ] Visual appearance of the changes.
[ ] Responsiveness and internationalization.
[ ] Strings and tooltips.
[ ] End-to-end functionality of buttons, interactions and flows.
[ ] Corner cases, error conditions, and easily imagined bugs.

This seems like probably not the cleanest solution. Would it work to instead write default: Optional[int]=settings.INVITATION_LINK_VALIDITY_MINUTES?

I have to wonder what possessed us to use minutes as a unit of anything in the API. Do our invitations expire faster in New York?
Anyway, this is a mypy inference bug.
from typing import Callable, TypeVar, Sequence

T = TypeVar("T")
def f(g: Callable[[], T], x: T) -> T:
    return x

x: object = 1
y: object = f(object, x)  # ok
z: object = f(object, 1)  # error: Argument 1 to "f" has incompatible type "Type[object]"; expected "Callable[[], int]"

We should maybe file it and add a comment. Also, I’d move the Optional[int] constant out of settings, since it’s not independently configurable, and its Optional[int] annotation is only for this specific weird purpose.

z: object = f(object, 1)  # error: Argument 1 to "f" has incompatible type "Type[object]"; expected "Callable[[], int]"

I think this demonstrates a different bug: mypy is mistaking the callable object with the type object.
Changing this argument from object to lambda: object() actually replicates the behavior in the PR.
from typing import Callable, TypeVar, Sequence

T = TypeVar("T")
def f(g: Callable[[], T], x: T) -> T:
    return x

x: object = 1
y: object = f(lambda: object(), x)  # ok
z: object = f(lambda: object(), 1)  # error: Argument 1 to "f" has incompatible type "Callable[[], object]"; expected "Callable[[], int]"
                                    # error: Incompatible return value type (got "object", expected "int")

It seems to me that mypy

binds T with x first (which is 1 in this case);
tries to substitute T -> int with Callable[[], T], yielding Callable[[], int];
runs into the incompatible type error when unifying the expected Callable[[], int] with the actual Callable[[], object].

Though mypy could have arguably bound T by the first encountered argument, the behavior here is expected.

We should maybe file it and add a comment. Also, I’d move the Optional[int] constant out of settings, since it’s not independently configurable, and its Optional[int] annotation is only for this specific weird purpose

zerver.views.invite feels like a good place for it to go.

object is a type, but it’s also a fine callable. Mypy knows that; that isn’t what it’s confused about.
Mypy should reason as follows:

The argument object has a subtype of the parameter type Callable[[], T]
⇔ Callable[[], object] is a subtype of Callable[[], T]
⇔ object is a subtype of T
The argument 1 has a subtype of the parameter type T
⇔ int is a subtype of T
The most specific type that satisfies both constraints is T = int.

Mypy has no trouble performing more complicated examples of this kind of reasoning:
from typing import Callable, TypeVar, Sequence

T = TypeVar("T")
U = TypeVar("U")
def f(g: Callable[[], tuple[T, U]], h: Callable[[], tuple[T, U]]) -> tuple[T, U]:
    return g()

def g() -> tuple[object, int]:
    return "s", 1

def h() -> tuple[int, object]:
    return 1, "s"

reveal_type(f(g, h))  # note: Revealed type is "Tuple[builtins.object, builtins.object]"

I suspect the problem is that it’s trying to take a shortcut where it incorrectly assumes that it can infer T directly from the parameter of type T without taking the other constraints into account.

I suspect the problem is that it’s trying to take a shortcut where it incorrectly assumes that it can infer T directly from the argument to the parameter of type T without taking the other constraints into account

Ah, that makes sense. Thanks for the intuition.

As further evidence that it should work, it works in Pyright.

This looks like https://github.com/python/mypy/issues/13064.

Updated this with a link to the mypy issue in both a comment and the commit message..

python/mypy#11610 and python/mypy#13064 look like different problems. The former involves the unchecked Any type, the latter involves an argument that’s also generic, and neither of them involve subtyping.

Opened python/mypy#13234.

This approach works for me, merged, thanks @PIG208 and @andersk!


fix: Solve the WSL connection failure issue, fixes #5634

The Issue
5634
How This PR Solves The Issue
This adds the google nameservers to the resolv.conf file, which allows apt to find the repositories needed to run apt install.
Manual Testing Instructions
Follow the instructions at as is: https://ddev.readthedocs.io/en/latest/users/install/ddev-installation/#windows to see the issue.
Remove the WSL and re run the instructions, but when running one of commands in the instructions to trigger the ddev installation script, use this command instead:
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/thegbomb/ddev/master/scripts/install_ddev_wsl2_docker_desktop.ps1'))

This command uses the forked version to install ddev, and the installation should complete as required.
Related Issue Link(s)
Open issue for WSL: https://github.com/microsoft/WSL/issues/8365
Duplicated issue with the resolution: https://github.com/microsoft/WSL/issues/4285

Your contribution (and research) are very much appreciated, but this wouldn't be appropriate for the general public. We may want to add some documentation about this workaround, or perhaps we'll want to add into the script a basic test for name resolution (like curl -f -I https://www.google.com) but this exact approach isn't appropriate. Again, thanks for the research and let's continue the conversation in #5634


update of home page

this time i have created a folder named homepage for the homepage, the folder contains a screenshot subfolder. moreover i have added a description.txt for getting to know what's in my PR in short. the rest two files are that of .css and .html, :-)

Don't create a folder for this, the repo should not contain unnecessary files, attach your screenshots and description in the format given to you here on PR itself, no extra files.


Added test to raise Element coverage to 100%

Closes #84

Excellent. Thank you very much for your contributions. I'll look over this shortly. Always good to get another issue closed.

Once again, thanks for your contributions :)


[vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs"

Describe the bug
Just got an error on the latest nuxt update.. after building, this shows up.
❯ yarn build
yarn run v1.22.19
$ nuxt build
Nuxi 3.4.1                                                                                8:08:41 PM

[8:08:48 PM]  ERROR  [vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

[8:08:48 PM]  ERROR  [vite]: Rollup failed to resolve import "@vueuse/head" from "D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/nuxt-og-image/dist/runtime/composables/defineOgImage.mjs".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external
  This is most likely unintended because it can break your application at runtime.
  If you do want to externalize this module explicitly add it to
  build.rollupOptions.external
  at onRollupWarning (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/vite/dist/node/chunks/dep-79892de8.js:46368:19)
  at onwarn (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/vite/dist/node/chunks/dep-79892de8.js:46138:13)
  at Object.onwarn (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:25149:13)
  at ModuleLoader.handleInvalidResolvedId (/D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:23784:26)
  at /D:/Projects/PersonalProjects/BroJenuelBlog/node_modules/rollup/dist/es/shared/node-entry.js:23744:26

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction
https://github.com/BroJenuel/BroJenuelBlog/tree/development
System / Nuxt Info
------------------------------
- Operating System: Windows_NT
- Node Version:     v18.14.0
- Nuxt Version:     3.4.1
- Nitro Version:    2.3.3
- Package Manager<EMAIL_ADDRESS>- Builder:          vite
- User Config:      ssr, modules, colorMode, routeRules, runtimeConfig, css, app
- Runtime Modules<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>- Build Modules:    -
------------------------------

it seems like installing "@vueuse/head" solve the problem but do I have to install it though?

Same here

Thanks for the issue!
This is fixed in the latest versions: v1.5.8, v2.0.0-beta.17.


Update file metadata

I could not find a specific way to update metadata, so I used gfs.files.update as in a regular mongoDB update but it behaves like save and not update; it just saves the update data to the collection and removes the existing data.

@Faleij mind posting an example of what u ended up doing (if you still have it lying around)?

I am sorry but I don't recall exactly what I ended up doing but you should be able to access the underlying native mongo collection by accessing the files property of your Grid object. Using files you can then call native mongo client collection functions such as update I believe.
Non-tested Example:
const gfs = Grid(db, mongo);
gfs.files.update(
  { 'metadata.name': 'My File' },
  { $set: { 'metadata.name': 'My Renamed File' } }
).then(console.log, console.error);

I seemed to try every variation, without much success. From gfs.files to
actually accessing the collection via gfs.db.collection('fs.files'), I
wasn't able to get a single query working, other than the built in
convenience methods (findOne, etc).
On Sunday, August 28, 2016, Faleij<EMAIL_ADDRESS>wrote:

I am sorry but I don't recall exactly what I ended up doing but you should
be able to access the underlying native mongo collection by accessing the
files
https://github.com/aheckmann/gridfs-stream/blob/master/lib/index.js#L56
property of your Grid object. Using files you can then call native mongo
client collection functions such as update
http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#update
I believe.
Non-tested Example:
const gfs = Grid(db, mongo);gfs.files.update(
{ 'metadata.name': 'My File' },
{ $set: { 'metadata.name': 'My Renamed File' } }
).then(console.log, console.error);
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aheckmann/gridfs-stream/issues/35#issuecomment-242967194,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEQruslfJxhIfqumMjAlr4sP-5uH6xdkks5qkWFkgaJpZM4BxI4M
.

'use strict';

const mongo = require('mongodb');
const Grid = require('gridfs-stream');

// create or use an existing mongodb-native db instance.
// for this example we'll just create one:
const db = new mongo.Db('faleijsGfsTest', new mongo.Server("<IP_ADDRESS>", 27017));

// make sure the db instance is open before passing into `Grid`
db.open()
    // !!!!!!!!!
    // !WARNING! THIS DROPS THE CURRENT DATABASE
    // !!!!!!!!!
    .then(() => db.dropDatabase())
    .then(() => {
        const gfs = Grid(db, mongo);

        return new Promise((resolve, reject) => {
            gfs.createWriteStream({ filename: 'my_file.txt' })
                .once('finish', resolve)
                .once('error', reject)
                .end('hello world');
        })
            .then(() => gfs.files.findOne({ filename: 'my_file.txt'}).then(file => console.log('should find file:', !!file)))
            .then(() => gfs.files.update(
                { filename: 'my_file.txt'},
                { $set: { filename: 'my_renamed_file.txt' } }
            ).then(res => console.log('should have modified:', res.result.nModified === 1)))

            .then(() => gfs.files.findOne({ filename: 'my_file.txt'}).then(file => console.log('should not find: ', !file)))
            .then(() => gfs.files.findOne({ filename: 'my_renamed_file.txt'}).then(file => console.log('should find rename', !!file)))
    })
    .catch(console.error);

This example that I wrote just now works fine for me. (Latest mongodb and gridfs-stream on nodejs v6.4 and MongoDB 3.2)

Thanks for sharing! I must be doing something wrong, I'll take another
look. I'm also using Mongoose.
On Sun, Aug 28, 2016 at 8:16 AM, Faleij<EMAIL_ADDRESS>wrote:

'use strict';
const mongo = require('mongodb');const Grid = require('gridfs-stream');
// create or use an existing mongodb-native db instance.// for this example we'll just create one:const db = new mongo.Db('faleijsGfsTest', new mongo.Server("<IP_ADDRESS>", 27017));
// make sure the db instance is open before passing into Griddb.open()
// !!!!!!!!!
// !WARNING! THIS DROPS THE CURRENT DATABASE
// !!!!!!!!!
.then(() => db.dropDatabase())
.then(() => {
const gfs = Grid(db, mongo);
    return new Promise((resolve, reject) => {
        gfs.createWriteStream({ filename: 'my_file.txt' })
            .once('finish', resolve)
            .once('error', reject)
            .end('hello world');
    })
        .then(() => gfs.files.findOne({ filename: 'my_file.txt'}).then(file => console.log('should find file:', !!file)))
        .then(() => gfs.files.update(
            { filename: 'my_file.txt'},
            { $set: { filename: 'my_renamed_file.txt' } }
        ).then(res => console.log('should have modified:', res.result.nModified === 1)))

        .then(() => gfs.files.findOne({ filename: 'my_file.txt'}).then(file => console.log('should not find: ', !file)))
        .then(() => gfs.files.findOne({ filename: 'my_renamed_file.txt'}).then(file => console.log('should find rename', !!file)))
})
.catch(console.error);

This example that I wrote just now works fine for me. (Latest mongodb and
gridfs-stream on nodejs v6.4 and MongoDB 3.2)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aheckmann/gridfs-stream/issues/35#issuecomment-242971628,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEQruqujMymSluG53D3tvAitwcUFIUG_ks5qkXwagaJpZM4BxI4M
.

I've been trying to do this for a whole day and I finally found a solution that works for me.... @Faleij thank you thank you thank you!


Improve flow list performance

mitmproxy's flow list is very slow: holding the down arrow to move the cursor causes it to visibly lag on my machine. The lag affects not just the UI, but the entire application - requests are slowed down as well.
Profiling (using cProfile) identified the bottlenecks as:

For every redraw, FlowListWalker was creating several instances of FlowList per flow for every redraw. This is because urwid.ListBox needs to iterate over the list more than once per redraw.

FlowListWalker uses commands.execute instead of calling View methods directly. The formatting and parsing of commands adds an additional performance cost. (This is a recent performance regression only in git, introduced by @madt1m in commit 773c9535146991af38f954cb4d3b0ead9d7485c5.)

raw_format_flow incorrectly had the entire Flow object added to its argument list. This caused needless work for @lru_cache, as it was hashing the entire Flow object as part of the cache key, and probably causing unnecessary cache misses as Flow properties changed without affecting the displayed content. (This is a performance regression, introduced by @Kriechi in commit d86cb76e5ba38c51b7d6017fb151e4946e3fb916.)

Profiling result:

The changes in this pull request rectify these problems, thus improving performance somewhat.

Ehi there! Nice piece of work you did here. Actually, there's a reason behind that change: the general assumption at the time of commit was that directly accessing the View addon from other tools is somewhat hacky, and this eventually lead to a Codebase clean-up, to make tools and add-ons communicate between themselves only through our command layer.

This looks like amazing work!

Thanks!

I do not recall the reasoning for changing raw_format_flow - so your guess is as good as mine.

From the commit in question (d86cb76e5ba38c51b7d6017fb151e4946e3fb916), it looks like at the time it wasn't obvious that all information about the flow was intended to be passed through the tuple parameter, so that @lru_cache would use it as a cache key.

the general assumption at the time of commit was that directly accessing the View addon from other tools is somewhat hacky, and this eventually lead to a Codebase clean-up, to make tools and add-ons communicate between themselves only through our command layer.

Yes, that makes sense; unfortunately, this particular change turned out to be on a hot path, so directly accessing internals may be worthwhile.

Looking a bit further down the profile graph, it seems like we could significantly alleviate this by lru-caching command.verify_arg_signature (14.61%) and command.lexer (5.3%)? That would also benefit other parts of mitmproxy.

Those sound like good directions for research. I'll need to figure out how to reliably profile this code path, so that I can get quantitative measurements of any improvements.

How about we just use functools.lru_cache(maxsize=None) for __get and then call self.__get.cache_clear() in view_changed?

Sounds good, I'll do this for now.

I'll need to figure out how to reliably profile this code path, so that I can get quantitative measurements of any improvements.

I wrote the following mitmproxy script:
from mitmproxy import ctx
import timeit

NUM_FLOWS = 100
NUM_SAMPLES = 10
NUM_ITERS = 1

def do_nav():
    for i in range(NUM_FLOWS):
        ctx.master.commands.call("console.nav.down")
    for i in range(NUM_FLOWS):
        ctx.master.commands.call("console.nav.up")

def do_bench(func):
    smallest_time = float('inf')
    for n in range(NUM_SAMPLES):
        time = timeit.timeit(func, number=NUM_ITERS)
        if smallest_time > time:
            smallest_time = time
    return smallest_time

ctx.log.alert('Measuring overhead...')
overhead = do_bench(do_nav)

for i in range(NUM_FLOWS):
    ctx.master.commands.call("view.flows.create", "get", "https://example.com/" + str(i))

ctx.log.alert('Benchmarking...')
time_all = do_bench(do_nav)
time = time_all - overhead

class ResultPrinter:
    def done(self):
        print('Result: ' + str(time) + ' (overhead ' + str(overhead) + ')')

addons = [
    ResultPrinter()
]

ctx.master.commands.call("console.exit")

With the above, I now have a clearer picture of which changes are actually worthwhile.
The first commit does not register a measurable performance improvement (I'm guessing I made a mistake when assessing the change), so we can probably drop it. The third commit also does not register an improvement in this benchmark, however the benchmark does not attempt to simulate false cache misses due to things changing in the flow that would not be reflected in raw_format_flow's first argument. Not sure how often those might occur in practice, but I would argue in its favour at least for pedantic correctness' sake.
The second commit, however, does result in a very significant speedup, going from 3.09 to 1.66 seconds according to the above script.

Looking a bit further down the profile graph, it seems like we could significantly alleviate this by lru-caching command.verify_arg_signature (14.61%) and command.lexer (5.3%)? That would also benefit other parts of mitmproxy.

It doesn't look like these changes would be as trivial. command.verify_arg_signature has a list in its argument list, which is apparently not compatible with @lru_cache. command.lexer merely returns a lexer, so some refactoring would be required to memoise it.

It doesn't look like these changes would be as trivial. command.verify_arg_signature has a list in its argument list, which is apparently not compatible with @lru_cache. command.lexer merely returns a lexer, so some refactoring would be required to memoise it.

command.lexer: Yeah, I misread the callgraph. It shouldn't be too difficult though - we'd need to move this chunk into its own function and cache it, which doesn't seem to have external dependencies. https://github.com/mitmproxy/mitmproxy/blob/e2bcca47b1ad8040451cbd95039acf200e9b0e84/mitmproxy/command.py#L160-L176

For command.verify_arg_signature, we can replace
https://github.com/mitmproxy/mitmproxy/blob/e2bcca47b1ad8040451cbd95039acf200e9b0e84/mitmproxy/command.py#L87
with
verify_arg_signature(self.func, tuple(args), None)

and
https://github.com/mitmproxy/mitmproxy/blob/e2bcca47b1ad8040451cbd95039acf200e9b0e84/mitmproxy/command.py#L274
with
verify_arg_signature(function, args, kwargs or None)

Could you give this a spin on your machine to have a consistent test setup? Thanks so much! 😃 😊

OK, I'm testing this patch:
diff --git a/mitmproxy/command.py b/mitmproxy/command.py
index 27f0921d..5283f328 100644
--- a/mitmproxy/command.py
+++ b/mitmproxy/command.py
@@ -14,10 +14,11 @@ from mitmproxy import exceptions
 import mitmproxy.types

-def verify_arg_signature(f: typing.Callable, args: list, kwargs: dict) -> None:
+@functools.lru_cache(maxsize=200)
+def verify_arg_signature(f: typing.Callable, args: tuple, kwargs: tuple) -> None:
     sig = inspect.signature(f)
     try:
-        sig.bind(*args, **kwargs)
+        sig.bind(*list(args), **dict(kwargs))
     except TypeError as v:
         raise exceptions.CommandError("command argument mismatch: %s" % v.args[0])

@@ -31,6 +32,28 @@ def lexer(s):
     return lex

+@functools.lru_cache(maxsize=200)
+def lex_string(cmdstr):
+    buf = io.StringIO(cmdstr)
+    parts: typing.List[str] = []
+    lex = lexer(buf)
+    while 1:
+        remainder = cmdstr[buf.tell():]
+        try:
+            t = lex.get_token()
+        except ValueError:
+            parts.append(remainder)
+            break
+        if not t:
+            break
+        parts.append(t)
+    if not parts:
+        parts = [""]
+    elif cmdstr.endswith(" "):
+        parts.append("")
+    return parts
+
+
 def typename(t: type) -> str:
     """
         Translates a type to an explanatory string.
@@ -84,7 +107,7 @@ class Command:
         return "%s %s%s" % (self.path, params, ret)

     def prepare_args(self, args: typing.Sequence[str]) -> typing.List[typing.Any]:
-        verify_arg_signature(self.func, list(args), {})
+        verify_arg_signature(self.func, tuple(args), ())

         remainder: typing.Sequence[str] = []
         if self.has_positional:
@@ -157,23 +180,7 @@ class CommandManager(mitmproxy.types._CommandBase):
         """
             Parse a possibly partial command. Return a sequence of ParseResults and a sequence of remainder type help items.
         """
-        buf = io.StringIO(cmdstr)
-        parts: typing.List[str] = []
-        lex = lexer(buf)
-        while 1:
-            remainder = cmdstr[buf.tell():]
-            try:
-                t = lex.get_token()
-            except ValueError:
-                parts.append(remainder)
-                break
-            if not t:
-                break
-            parts.append(t)
-        if not parts:
-            parts = [""]
-        elif cmdstr.endswith(" "):
-            parts.append("")
+        parts = lex_string(cmdstr)

         parse: typing.List[ParseResult] = []
         params: typing.List[type] = []
@@ -271,7 +278,7 @@ def command(path):
     def decorator(function):
         @functools.wraps(function)
         def wrapper(*args, **kwargs):
-            verify_arg_signature(function, args, kwargs)
+            verify_arg_signature(function, args, tuple(kwargs.items()))
             return function(*args, **kwargs)
         wrapper.__dict__["command_path"] = path
         return wrapper

Applied to master, it brings the benchmark result from 2.98 to 1.96, which is quite significant! By itself, it's not as great as the second commit in this PR, though. If the patch looks good, I can add it to this PR too.

Would you mind opening a separate PR for that?

OK, here it is: https://github.com/mitmproxy/mitmproxy/pull/3428

Your second commit breaks some isolations we wanted to establish so it might be a bit controversial.

Perhaps an additional, abstract interface of sending commands using a more performance-friendly model (tuples and identifiers instead of strings)?


Need to always type name of package to use accessors

Hello again
Presumably it was an intentional decision, but it's inconvenient having to always use, for example, AbstractFBCModels.genes() when using model accessors, instead of just genes(). Obviously you can import AbstractFBCModels as A and then only need A.genes() but that is still unwieldy...
Would be nice if functions could be exported in the package so that they can be used in COBREXA in the same way as in v1.

The option to export everything would be nice, then it's up to the user if they make a big mess or not :smile:

yap, there should always be that option, right :]
I'll see ASAP.

Thanks!


Unable to configure

Hi, I added Icebreaker to a team via Teams store, but every time I try and configure the bot, I receive a "There was a problem reaching this app" error with no other information. Is this a known issue/is there a fix for this?

Hi @kh315 ,
Thanks for raising the query. Could you please share the deployment status of App service. Here is the reference.

Hi @gsv022 , how do I view that when I added the app via Teams store?

Hi @kh315 ,
In order to better understand the issue you're describing, could you please share a screenshot that supports your explanation?
As I understand it, once the app is added to a team, it will trigger the template automatically on a scheduled basis, and this communication will be one-way. Additionally, it seems that once the Icebreaker bot is added to a team, there is no need for any further configuration. If my understanding is incorrect, could you please clarify the matter for me?

Is there no way to edit the schedule? Also after I added this bot, no one in the team ever got paired. I also want to be able to exclude members from the pairings

Please share the repo url and branch that has been used for Icebreaker deployment

Like I said earlier, Icebreaker was added via the app store on Teams, so I don't know where the repo url and branch would be.

@kh315 ,
Please note that our support scope is very limited and can assist for the standard version of Icebreaker. Here is the link for Icebreaker official version. And the screenshots you shared are not part of our official version.
Please let us know if you have any queries with official version otherwise we can make it to closure.


Difference from golang.org/x/time/rate#Limiter

I am curious what is advantages of this pkg vs https://pkg.go.dev/golang.org/x/time/rate#Limiter
Might be good to document it visibly

@nikolaydubina Thanks for opening this issue.
The original library implements the classical "token bucket" algorithm, allowing a burst of tokens and a refill that happens at a specified ratio by one unit at a time.
This implementation, instead, is a variant that allows a burst of tokens just like "the token bucket" algorithm, but the refill happens entirely at the defined ratio.
This allows scanners to respect maximum defined rate limits, pause until the allowed interval hits, and then process again at maximum speed. The original library slowed down requests according to the refill ratio.
Good point about improving the documentation. we will do the following:

[ ] Update README.md with the above description in a new section Differences with https://pkg.go.dev/golang.org/x/time/rate#Limiter

Nice! Very clear now!
On Mon, 14 Nov 2022 at 05:46, Mzack9999 @.***> wrote:

@nikolaydubina https://github.com/nikolaydubina Thanks for opening this
issue.
The original library https://pkg.go.dev/golang.org/x/time/rate#Limiter
implements the classical "token bucket" algorithm, allowing a burst of
tokens and a refill that happens at a specified ratio by one unit at a time.
This implementation, instead, is a variant that allows a burst of tokens
just like "the token bucket" algorithm, but the refill happens entirely at
the defined ratio.
This allows scanners to respect maximum defined rate limits, pause until
the allowed interval hits, and then process again at maximum speed. The
original library slowed down requests according to the refill ratio.
Good point about improving the documentation. we will do the following:

Update README.md with the above description in a new section Differences
with https://pkg.go.dev/golang.org/x/time/rate#Limiter

—
Reply to this email directly, view it on GitHub
https://github.com/projectdiscovery/ratelimit/issues/11#issuecomment-1312830139,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAWMCRLZTHENOT4FCLPR6RTWIFOUDANCNFSM6AAAAAAR6HKGCI
.
You are receiving this because you were mentioned.Message ID:
@.***>


Add App Extension model

I want to merge this change because it adds AppExtension model

Impact

[ ] New migrations
[ ] New/Updated API fields or mutations
[ ] Deprecated API fields or mutations
[ ] Removed API types, fields, or mutations
[ ] Documentation needs to be updated

Pull Request Checklist

[ ] Privileged queries and mutations are guarded by proper permission checks
[ ] Database queries are optimized and the number of queries is constant
[ ] Database migration files are up to date
[ ] The changes are tested
[ ] GraphQL schema and type definitions are up to date
[ ] Changes are mentioned in the changelog

Task linked: SALEOR-3839 New model AppExtension


Throw when constructing JSONValue from nan/inf.

Addresses issue #14399.
The JSONValue constructor would accept nan/inf float values, for which it would
produce the strings "nan" and "inf".
However, parseJSON would throw on encountering these values in a json string.
This patch causes JSONValue's constructor and assign operator to throw when
given NaN, Inf, or -Inf, as NaN and Inf are not officially supported by the JSON
standard (see http://tools.ietf.org/html/rfc4627, section 2.4).
The decision to fail early arose from the discussion on PR #3141.
https://issues.dlang.org/show_bug.cgi?id=14399

Superseded by #3141.


Speed up skdate tests by parallelizing execution and storing generated inputs

Checking how this affects CircleCI times

Pending CircleCI numbers, but these changes speed up the skdate test suite from ~6 minutes to ~1 minute on my machine.
Parallelized where possible, and stored much more pre-generated input than the initial commit in this stack.

Nice!

2.4 million lines changed. This is going to take a while to review, bear with me.

Clearly we need PSC to capitalize on LOC changed. :-)


Integrate Paypal

I'm going to create a payment service, which will have an affect on this, thus I'm going to temporarily leave it alone till PAYMENT SERVICE is ready.
Integrate Paypal

https://user-images.githubusercontent.com/62151844/233975370-13b7879f-054d-489e-8602-31f8f5d33dbe.mp4

cancel


Cannot find publishednodes.json on Windows

We installed IoT Edge on a Windows PC.  The OPC Publisher module is starting but it cannot see the publishednodes.json file.  We updated the "Binding" area to point to our file, but that did not resolve the issue.
publishednodes.json:
[
  {
    "EndpointUrl": "opc.tcp://<server>/OPCUA/SimulationServer",
    "UseSecurity": false,
    "OpcNodes": [
      {
        "Id": "ns=3;i=1001",
      },
      {
        "Id": "ns=3;i=1007",
      }
  },
]

Module configuration:
{
  "Hostname": "publisher",
  "Cmd": [
    "publisher",
    "--di=60",
    "--to",
    "ll=debug",
    "--aa",
    "--si",
    "0",
    "--ms",
    "4096",
    "--pf=./publishednodes.json"
  ],
  "HostConfig": {
    "Binds": [
      "c:/iiotedge:c:/appdata"
    ],
    "PortBindings": {
      "62222/tcp": [
        {
          "HostPort": "62222"
        }
      ]
    },
    "ExtraHosts": [
      "localhost:<IP_ADDRESS>"
    ]
  }
}

The file exists in c:\app.  We have confirmed that the file name is "publishednodes.json".  ie.  ".txt" is not appended.

Log is below. Note this entry: "The node configuration file './publishednodes.json' does not exist. Continue and wait for remote configuration requests."
[10:19:04 INF] Current directory is: C:\app
[10:19:04 INF] Log file is: publisher-publisher.log
[10:19:04 INF] Log level is: info
[10:19:04 INF] OPC Publisher V2.5.3 starting up...
[10:19:04 INF] OPC UA monitored item notifications with one of the following 2 status codes will not generate telemetry events:
[10:19:04 INF] StatusCode: BadNoCommunication (dec:<PHONE_NUMBER>, hex: 80310000)
[10:19:04 INF] StatusCode: BadWaitingForInitialData (dec:<PHONE_NUMBER>, hex: 80320000)
[10:19:04 INF] opcstacktracemask set to: 0x0
[10:19:04 INF] OperationTimeout set to 120000
[10:19:04 INF] OPC UA server base address: opc.tcp://publisher:62222/UA/Publisher
[10:19:04 INF] Security policy http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256 with mode SignAndEncrypt added
[10:19:04 INF] Trusted Issuer store type is: Directory
[10:19:04 INF] Trusted Issuer Certificate store path is: pki/issuer
[10:19:04 INF] Trusted Peer Certificate store type is: Directory
[10:19:04 INF] Trusted Peer Certificate store path is: pki/trusted
[10:19:04 INF] Rejected certificate store type is: Directory
[10:19:04 INF] Rejected Certificate store path is: pki/rejected
[10:19:04 INF] Rejection of SHA1 signed certificates is disabled
[10:19:04 INF] Minimum certificate key size set to 1024
[10:19:04 INF] Application Certificate store type is: Directory
[10:19:04 INF] Application Certificate store path is: pki/own
[10:19:04 INF] Application Certificate subject name is: publisher
[10:19:04 WRN] WARNING: Automatically accepting certificates. This is a security risk.
[10:19:04 INF] Application certificate with thumbprint '3E9A51A0C54C2684220655276538BC907794B580' found in the application certificate store.
[10:19:04 INF] Application certificate is for ApplicationUri 'urn:publisher:publisher:microsoft:', ApplicationName 'publisher' and Subject is 'publisher'
[10:19:04 INF] Adding server certificate to trusted peer store. StorePath=pki/trusted
[10:19:04 WRN] Can not add server certificate to trusted peer store. Maybe it is already there.
System.ArgumentException: A certificate with the same thumbprint is already in the store.
   at Opc.Ua.DirectoryCertificateStore.Add(X509Certificate2 certificate, String password)
   at OpcPublisher.OpcApplicationConfiguration.InitApplicationSecurityAsync() in D:\a\1\s\modules\src\Microsoft.Azure.IIoT.Modules.OpcUa.Publisher\src\OpcApplicationConfigurationSecurity.cs:line 240
[10:19:04 INF] LDS(-ME) registration intervall set to 0 ms (0 means no registration)
[10:19:04 INF] Trusted issuer store contains 0 certs
[10:19:04 INF] Trusted issuer store has 0 CRLs.
[10:19:04 INF] Trusted peer store contains 1 certs
[10:19:04 INF] 01: Subject 'CN=publisher' (thumbprint: 3E9A51A0C54C2684220655276538BC907794B580)
[10:19:04 INF] Trusted peer store has 0 CRLs.
[10:19:04 INF] Rejected certificate store contains 0 certs
[10:19:04 INF] There is no site configured.
[10:19:04 INF] Starting server on endpoint opc.tcp://publisher:62222/UA/Publisher ...
[10:19:05 INF] Server started.
[10:19:05 INF] Using default telemetry configuration.
[10:19:05 INF] The name of the configuration file for published nodes is: ./publishednodes.json
[10:19:05 INF] The node configuration file './publishednodes.json' does not exist. Continue and wait for remote configuration requests.
[10:19:05 INF] There are 0 nodes to publish.
[10:19:05 INF] Create module client using 'Amqp_Tcp_Only' for communication.
[10:19:05 INF] IoTCentral mode: False
[10:19:26 ERR] Connection status changed to 'Disconnected', reason 'Retry_Expired'
[10:19:27 INF] Connection status changed to 'Connected', reason 'Connection_Ok'
[10:19:27 INF] Message processing and hub communication configured with a send interval of 0 sec and a message buffer size of 4096 bytes.

Was able to resolve the issue with help from a colleague.  Setting the "pf" parameter to point to the directory that publishednodes.json fixed the issue:
{
  "Hostname": "publisher",
  "Cmd": [
    "publisher",
    "--di=60",
    "--to",
    "--aa",
    "--si",
    "0",
    "--ms",
    "4096",
    "--pf=c:/appdata/publishednodes.json"
  ],
  "HostConfig": {
    "Binds": [
      "c:/iiotedge:c:/appdata"
    ],
    "PortBindings": {
      "62222/tcp": [
        {
          "HostPort": "62222"
        }
      ]
    },
    "ExtraHosts": [
      "localhost:<IP_ADDRESS>"
    ]
  }
}
'''


Range.size inconsistencies

I noticed an issue in a program when I had a range of Range.new(0_u32, UInt32::MAX) and I asked it for its size.  It gives back 0.
I tried Range.new(0, UInt32::MAX).size and this actually caused my program to hang (indefinitely as far as I could stand to tell).
I'm not sure what the result of size should be... as far as the Type is concerned, but I do know that the current behavior probably isn't the right one.
The only thing I could find relating to this was #1895.
I'm running Crystal 0.20.1 (2016-12-05) on macOS 10.12.2.  And the problems existed in both a normal build, and a release build.

The problem is that 0 is Int32 and when counting up it will overflow and never reach UInt32::MAX so it will count forever. This will be solved once we do something about overflows. So I'll close this as a duplicate (or in favor of) #3103


Release v0.4

The PR prepares a HAL and RAL 0.4 release. We also release 0.1 of the IOMUXC crates with this release.

This all makes sense to me!


I forked you

Hi,
I added some features to this bundle in my fork:

CLI schema generation (based on doctrine or php)
annotation validation
translations (probably a lot to improve there, just a proof of concept for now)

Are you interested by those features? I could send a PR, but I'm not sure about the primary goal of this bundle, or how much is it supposed to do.
Cheers

Hi,
thank you, I will research it this weekend and answer you right after that. In general, I'd like to merge it.
If you are interested in active development of the project and we will find an appropriate way to do it - I think it makes sense to grant you a permissions for merging and so on.
Cheers!

Looks like that didn't happen?


Update to Gradle 7 and Java 14

This is not an Android app so no reason to use an obsolete version of the JDK

it doesn't work, closing for now


Improves version extraction in installation script

name: Cross-platform Version Parsing Update
about: Updates version parsing logic in install script
title: "[PR] Improve version extraction for cross-platform compatibility"
labels: 'enhancement'
assignees: ''
Description
Updates the version extraction logic in the install script to use a more robust and cross-platform compatible approach using grep and sed. This change improves reliability when parsing GitHub release versions across different platforms and shell environments.
The new implementation:

Uses a more reliable grep pattern that handles varying whitespace
Simplifies the parsing chain to reduce potential points of failure
Maintains compatibility across different Unix-like systems

Related issue: N/A
How to Test

Run the install script on different platforms (macOS, Linux) to verify version extraction:./install.sh

Verify that the script correctly extracts the version number from GitHub releases
Check that the extracted version matches the latest release on the GitHub repository

Screenshots/Proof
The script successfully extracts version "x.y.z" from the GitHub API response:
Before: echo "$LATEST_RELEASE" | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | sed 's/^v//'
After:  echo "$LATEST_RELEASE" | grep -o '"tag_name": *"v[^"]*"' | sed 's/.*"v\([^"]*\)".*/\1/'

/tip $30 @fortran01
thx!


Add in FAQ

Add in FAQ (based on this http://www.cs.umd.edu/~jonf/advising.html) that also has a ugrad research apply link.
Update: now that @htadeusiak is going to work on this, I want to be more clear what I was envisioning here. I want to base the general design on this page https://sidewalk.cs.washington.edu/faq and https://sidewalk-test.cs.washington.edu/labelingGuide where we have a floating left menu bar of questions (should be hierarchical with an expanding menu--otherwise, the floating menu will be overwhelming).

Here is my first draft of the FAQ. I tried copying the format of the labeling guide from Project Sidewalk. Correct me if I am wrong, but the labeling guide would open a new page every time you chose a different obstacle from the panel. I feel like that is slightly inefficient so I removed it from my solution. The webpage will only load once at the beginning.
I have not done any CSS to it so it's a bit bare. But, I wanted to check with you to see if this is the functionality you want out of this page before I continue.

Woohoo! Looks great. I think we should have a header on the FAQ (to make us feel more accessible and fun--maybe the same header as the people page; I can help with this but just put the standard header code in there).
I'll obviously have to edit some of the text because it's old and written for UMD but we can do that after we finalize on the design and get the PR merged on makeability-test.
Could you try to reduce the indentation of the questions under the sub-headers. Too much whitespace on the left.

This example is what would be in the "content" of the page. So yes header and footer will be there.
I know that all the pages extend the base.html page, can we do that with this page? Or should I just copy the header and footer code from that page into this one?
I'll fix the indentation.

Just extend base.html--that should be fine.
And then I agree with you that eventually we will want to Django'fy this (will want to create another Issue for it) so that we can add and edit content via the Django admin interface. However, before we do so, I want to find a rich text editor plugin for Django. Can you make this new issue?

Added the banner, header, and footer through extend base.html. Adjusted the white space indents.
I also added some css transitions to the panel guide. I can refine them more, but wanted your opinion on if you wanted them for this page.
Is there anything else that you wanted for this page I missed?

Looks excellent. Very nice job!!
Sent from my iPhone

On Dec 23, 2018, at 5:33 PM, Hank Tadeusiak<EMAIL_ADDRESS>wrote:
Added the banner, header, and footer through extend base.html. Adjusted the white space indents.
I also added some css transitions to the panel guide. I can refine them more, but wanted your opinion on if you wanted them for this page.
Is there anything else that you wanted for this page I missed?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Allow adding metadata for chunks of files

Currently only add_texts takes an 'metadata' argument but add_data does not. Since add_data takes an array of files it would be clunky to extend it to allow metadata directly. Adding metadata needs to happen on a chunk-level.
The use case i have for this is to add the page number a chunk was found on and reference that as the source of the information.
To work around it i am currently reading and chunking files manually and then calling add_texts to supply the metadata. It's not too difficult but it would be nice if this was easier.

@drale2k Do you think this functionality should go into https://github.com/moekidev/baran which is the gem we're using to do chunking?

Good question given that baran is a Text Splitter specifically for LLMs but even if baran were to accept metadata, langchainrb still needs to take it as input. You still want people to interact with the lanchainrb APIs and not baran directly or?

@drale2k Correct, I'm just saying that those changes would need to happen in the baran gem itself first and then Langchain.rb would make the corresponding changes to accept metadata. I think instead of returning the plain chunks array, baran should return a different data structure that would hold all that metadata as well. Do you want to suggest those changes to @moekidev?

https://github.com/moekidev/baran/issues/7#issuecomment-1734999638

We released! https://github.com/moekidev/baran/releases/tag/v0.1.9

Currently mostly pinecone but have been looking into open source ones as well. PDFs, MS Office docx and ppt mostly. Starting to look into audio transcriptions as well using https://github.com/guillaumekln/faster-whisper

this would help support the ability to add metadata such as source document names / source urls for the text.
I can see this being useful in add_data by optionally being able to pass an array of objects vs just string paths.  checking the class of the "path" object before passing it to the chunker so and object that looks like
{ path: 'string/path/to/file', metadata: { url: "https://some.location.com/some-page-name", path: 'string/path/to/file', style: "blues" }

could be sent to the chunker would be nice.  Then when we ask the vectorsearch database for similarities we should also get the metadata back to use for source links

I'm still reading code... It looks like Langchain::Loader actually will take a url!  That is nice.  I'll have to give that a try.  It would be nice if the url was passed into the vectorsearch database as metadata directly.
I'm wishing out loud and should definitely consider making a pull request.
Thanks for making this a lot easier!

@jjimenez Take a look at this draft branch I'm working on: https://github.com/andreibondarev/langchainrb/pull/538/files. The rest of the vectorsearch DBs need to be fixed to accept the metadatas: param.

any news on this feature ?

I'm interested in this feature, particularly for pgvector. I'm noticing that the different vectorsearch dbs don't all currently have a schema to support storing this new metadata.  Would this be something you would be interested in help with?

I'm interested in this feature, particularly for pgvector. I'm noticing that the different vectorsearch dbs don't all currently have a schema to support storing this new metadata. Would this be something you would be interested in help with?

@sean-dickinson Yes! Any help here would be extremely appreciated! Do you have a DSL in mind we'd implemented?

I'm interested in this feature, particularly for pgvector. I'm noticing that the different vectorsearch dbs don't all currently have a schema to support storing this new metadata. Would this be something you would be interested in help with?

@sean-dickinson Yes! Any help here would be extremely appreciated! Do you have a DSL in mind we'd implemented?

@andreibondarev I'm not sure it's so much a DSL as a standardized schema for storing the data. That being said I'm not very knowledgeable in terms of the different vector databases here, but I'm assuming that in an ideal schema we would be able to store an object the represents the original data source (with a unique identifier) and then a collection of objects with the actual text splits that reference the original source.
The metadata field could live on either the parent or the chunks, (or both I suppose if you wanted?) but probably on the parent makes the most sense? Then when you do a search you are searching the chunks and you can also grab the parent record that the chunks reference to get the metadata.
I'm thinking this schema allows for the easiest updates if you are using sources change (for instance if your source is a url and the content updates, the url is the same but you want to clear out the old chunks and add new ones).
Note I'm taking these ideas from the LangChain python pgvector implementation.
In terms of a DSL, maybe it makes sense to name the concept of data like a DataSource to help conform to a more structure schema?

@sean-dickinson I think I would be more in favor of an iterative approach here: enhancing and standarding the current schema across all the different vectorsearch DBs as opposed to overhauling it. We can slowly iterate towards the ideal state eventually.

@sean-dickinson I think I would be more in favor of an iterative approach here: enhancing and standarding the current schema across all the different vectorsearch DBs as opposed to overhauling it. We can slowly iterate towards the ideal state eventually.

@andreibondarev totally fair. I think we can essentially achieve the same functionality with just adding a metadata field for each of the vector dbs like you said, then it could always be improved upon in the future should the need arise.
Regardless, what's the state of your branch referenced here where you added the metadata as part of the parsing process? Do you want to build on that and update all the vector db adapters to expect this new field on that branch? Or do you want a separate PR to update all the vector db schemas?

@sean-dickinson I think maybe we, first, standardize the metadata: {} param for all of the different vectorsearch providers.
We could probably do Pgvector first, I think you'd need to some sort of a metadata JSON column and change this method: https://github.com/patterns-ai-core/langchainrb/blob/main/lib/langchain/vectorsearch/pgvector.rb#L73-L83
What're your thoughts?

I took a stab at this for pgvector following the guidance of the above comment https://github.com/patterns-ai-core/langchainrb/pull/859


【Wanted Help・ ERC2771 Forwarder】 write code Metatrasactions'S test code

I would like to prepare a test code for a smart contract using @openzeppelin/contracts/metatx/ERC2771Forwarder.sol.
I have created a test code referring to the file under the test folder, but an error occurs in the verify method of the forwarder contract. I believe there is a problem with the signature data, but I would like to know if you know of a specific fix.
My Forwarder Contract code is here
import<EMAIL_ADDRESS>
contract ERC2771ForwarderMock is ERC2771Forwarder {

    struct ForwardRequest {
        address from;
        address to;
        uint256 value;
        uint256 gas;
        uint256 nonce;
        uint48 deadline;
        bytes data;
    }
    constructor(string memory name) ERC2771Forwarder(name) {}

    function structHash(ForwardRequest calldata request) external view returns (bytes32) {
        return
            _hashTypedDataV4(
                keccak256(
                    abi.encode(
                        _FORWARD_REQUEST_TYPEHASH,
                        request.from,
                        request.to,
                        request.value,
                        request.nonce,
                        request.gas,
                        request.deadline,
                        keccak256(request.data)
                    )
                )
            );
    }
}

My Test code is here
describe("MetaTransaction", function () {

   async function relay(
    forwarder: any,
    request: any,
  ) {
    console.log("request:", request)
    // まずトランザクションデータを検証する。
    // const valid = await forwarder.verify(request);
    //if (!valid) throw new Error(`Invalid request`);

    // 検証して問題なければトランザクションを実行して Recipientコントラクトの処理を呼び出す。
    const gasLimit = (parseInt(request.gas) + 50000).toString();
    // forward コントラクトのexecuteメソッドを呼び出す。
    await forwarder.execute(request, { gasLimit });
    return
  }

    it("Gasless tranfer NFT", async function () {
      const { mockNFTV1, forwarder, owner, addr1 } = await loadFixture(deployTokenFixture);
      // mint NFT
      await mintNft(mockNFTV1, owner, addr1.address, "mock", 1);

      const beforeBalance = await mockNFTV1.balanceOf(owner.address);
      const beforeBalance2 = await mockNFTV1.balanceOf(addr1.address);

      const beforeEthBalance = await addr1.provider.getBalance(addr1.address);

      const data = mockNFTV1.interface.encodeFunctionData('safeTransferFrom(address,address,uint256)', [addr1.address, owner.address, 0]);

      const {
        request,
        signature,
      } = await signMetaTxRequest(owner, forwarder, {
        to: await mockNFTV1.getAddress(),
        from: addr1.address,
        data
      });

      request.signature = signature;

      await relay(forwarder, request);

      const afterBalance = await mockNFTV1.balanceOf(owner.address);
      const afterBalance2 = await mockNFTV1.balanceOf(addr1.address);
      const afterEthBalance = await addr1.provider.getBalance(addr1.address);

      expect(beforeBalance).to.equal(0);
      expect(beforeBalance2).to.equal(1);
      expect(afterBalance).to.equal(1);
      expect(afterBalance2).to.equal(0);
      expect(beforeEthBalance).to.equal(afterEthBalance);
    });

helper's code is here
import ethSigUtil from 'eth-sig-util';
import { ethers } from "ethers";

const EIP712Domain = [
  { name: 'name', type: 'string' },
  { name: 'version', type: 'string' },
  { name: 'chainId', type: 'uint256' },
  { name: 'verifyingContract', type: 'address' }
];

const ForwardRequest = [
  { name: 'from', type: 'address' },
  { name: 'to', type: 'address' },
  { name: 'value', type: 'uint256' },
  { name: 'gas', type: 'uint256' },
  { name: 'nonce', type: 'uint256' },
  { name: 'deadline', type: 'uint48' },
  { name: 'data', type: 'bytes' },
];

export function getMetaTxTypeData(
  chainId: any,
  verifyingContract: any
) {
  return {
    types: {
      ForwardRequest,
    },
    domain: {
      name: 'ERC2771ForwarderMock',
      version: '0.0.1',
      chainId,
      verifyingContract,
    },
    primaryType: 'ForwardRequest',
  }
};

export async function signTypedData(
  signer: any,
  data: any
) {
  return await signer.signTypedData(data.domain, data.types, data.request)
}

export async function buildRequest(
  forwarder: any,
  input: any
) {
  const nonce = await forwarder.nonces(input.from).then((nonce: any) => nonce.toString());
  const numberNonce = Number(nonce);
  const currentTimestamp = Math.floor(new Date().getTime() / 1000);
  const oneWeekInSeconds = 60;
  const futureTimestamp = currentTimestamp + oneWeekInSeconds;
  const uint48Value = ethers.toNumber(futureTimestamp);
  return {
    data: input.data,
    deadline: uint48Value,
    from: input.from,
    gas: 100000,
    nonce: numberNonce,
    to: input.to,
    value: 0,
  };
}

export async function buildTypedData(
  forwarder: any,
  request: any
) {
  const chainId = 31337;
  const typeData = getMetaTxTypeData(chainId, await forwarder.getAddress());
  return { ...typeData, request };
}

export async function signMetaTxRequest(
  signer: any,
  forwarder: any,
  input: any
) {
  const request = await buildRequest(forwarder, input);
  const toSign = await buildTypedData(forwarder, request);
  const signature = await signTypedData(signer, toSign);
  return { signature, request };
}

test code's result is here
 24 passing (7s)
  1 failing

  1) Upgradable NFT contract's test
       MetaTransaction
         Gasless tranfer NFT:
     Error: VM Exception while processing transaction: reverted with custom error 'ERC2771ForwarderInvalidSigner("0x6e1B8e2C47a6ae080eEdaA9264055c20cc414744", "0x70997970C51812dc3A010C7d01b50e0d17dc79C8")'
    at ERC2771ForwarderMock.executeBatch (@openzeppelin/contracts/metatx/ERC2771Forwarder.sol:182)
    at ERC2771ForwarderMock.execute (@openzeppelin/contracts/metatx/ERC2771Forwarder.sol:134)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Why from address & recovered address are not match??

This repository is for upgrades plugins, which does not look related to your question.
Please consider asking your question on the forum https://forum.openzeppelin.com/

OK! Thank you !!


update per GiorgosPa OnLookup pattern

Previously - GiorgosPa wrote:
I am afraid this approach also poses issues as it allows for modifications of the email just before it is sent.
What we can do though to support your scenario is to provide OnLookup event that you can use for your needs.
You can add triggers like bellow on each field:
trigger OnLookup(var Text: Text): Boolean
var
    LookupOk: Boolean;
begin
    OnLookupToRecipient(Text, LookupOk);
    exit(LookupOk)
end;

and the necessary events on the page like:
[IntegrationEvent(false, false)]
local procedure OnLookupToRecipient(var ToRecipient: Text; LookupOk: Boolean)
begin
end;

I prototyped the pattern - it works if there is a way for the subscriber to know which instance of the Email Editor raised the event.
This is necessary because the EmailEditor page extension loads content that is specific to the message -- e.g., Customer/Contact addresses for a specific sales order, etc.
I updated my PR to include the suggested pattern - please let me know if it is acceptable.
Here is a quick demo of the (rough) prototype:  [https://youtu.be/Ah26At-VLuA]
FYI - my intent is to release this as a free app (it will be a teaser for my paid app).

Please note:
where @grobyns comments: there's no need for these variables to be exposed. you can undo this change
In order for a page extension to perform pre-validation (in the OnBeforeValidate trigger) the variables must be in the protected scope.  that is one of the goals for this PR.

@quadfin please update your branch it seams your merge with master went wrong and there are unrelated changes included

@GiorgosPa, I fetched/merged upstream - branch is now in sync with microsoft:master + this change https://github.com/quadfin/ALAppExtensions/commit/34bb842e45a9868d9e60576829f62f9481b6d040
PR shows 1 file changed:  Modules/System/Email/src/Email/Outbox/EmailEditor.Page.al

I just watched your teaser - it looks really neat! However, as I mentioned in one of your previous PRs (https://github.com/microsoft/ALAppExtensions/pull/12559#discussion_r641424316), this simple version of the address book is going to overlap to a high degree, with what we're working on / have planned. From your message, it sounds as if you plan to make an even more capable, payed version, where we won't be going. But your freemium and our "base" address book will overlap to some extend. I understand the concept of a freemium version, at attract buying customers, but somehow that model also goes against my hopes with this open source project. Having an address book in the email editor, was one of those functionalities I had hoped would get contributed - or at least we would work together on. It should be considered "must" functionality, that has to be existing by default when the product is "installed" and not be an add-on, that every customer must install.
Be that as it may, we will of course make sure that our address book is fully replaceable with more capable ones - such as yours. We're most likely going to add a handled pattern to support this.
But before we go ahead and provide those, I just have to ask directly: you are not interested in providing a PR a little richer, than integration events, are you? ;-) Right now, we don't really have a good reward model yet for partners who actively contribute, other than a mention at launch events or the like, but I'm thinking about ways to make it worthwhile for the community, to contribute with a little more, than events.
On that note, I wish you a great weekend. If nothing else, we'll process this PR to enable you to add your very cool address book :-)

@JesperSchulz-
Thanks for the reply and insight.
I am a bit uncertain what this means: “…you are not interested in providing a PR a little richer, than integration events, are you?”
Are you are asking if I am interested to open source my implementation?
If so, the answer is yes, as long as I have the ability to position my (paid) product as a more capable successor.
If you would like to discuss in more detail can we take this conversation offline?
I have your direct email from a previous conversation – should I contact you?
Regards,
Phil

Please do so, yes :-) I'd be happy to have a call with you! My week actually looks pretty open, for once (summer vacation time kicking in, I guess). Feel free to book a 30 min call at any time!

Update: we're going to push a PR of an alpha version of our address book on GitHub later today. It's far from complete, but should give you an idea of in which direction we're heading. Of course we would be excited if you chip in and help us complete creating an address book, that  our customers will love, and that you can extend to become even greater :-) I will go on an extended summer break soon, but others on my team should be able to assist, if you have any questions/feedback. Looking forward to collaborate with you on this!

Let's track further progress/requirements in the new PR #13165.

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


I can not uninstall the extension

how I can uninstall this extension. When I uninstall it  and restart vs code, the extension is still there

That is strange? VSCode handles the install and uninstall of extensions itself. Are you following this method to uninstall? You could also try deleting the extensions folder willasm.project-notes-1.5.0 directly (while vscode is closed). It should be in under %USERPROFILE%\.vscode\extensions.

when i type %USERPROFILE%.vscode\extensions in my file explorer search bar, then when i search willasm.project-notes-1.5.0 it tells me NO items match your search.

Your missing the backslash after %USERPROFILE% it should be %USERPROFILE%.vscode\extensions

The full location is C:\Users<yourusername>.vscode\extensions

I typed that and still it is not there. C:\Users<yourusername>.vscode\extensions\willasm.project-notes-1.5.0

Are you replacing  with your actual user name?

yes of course.

Here is an easier way to find it. Within VSCode, press ctrl + shift + p, and type: "Open Extension Folder". That will open the extensions folder in file explorer. Then close vscode and then delete the extensions folder. (willasm.project-notes-1.5.0)

Please do note that you must have some issue with either vscode or windows itself as extensions have no way to control the install or uninstall process. That is completely handled by vscode itself. Here is a Youtube Video showing how to remove an extension to help you as a guide. Let me know if it works.

I figured out what was the problem. It turns out that I have to unchecked from the activity bar first before uninstall the extension.  Thanks for your help

Glad you solved the issue.


Dumb Question

Hi guys! Been trying to reach you on G+, but no luck.
I've got a stupid question, in code examples I found this code:
var children = _glow[GlowTags.CollectionItem][GlowTags.Node.Children];
for(int index = 0; index < 2000; index++)
{
var node = new GlowNode(5 + index)
{
Identifier = "abc" + index,
Description = "Hallo ich bin Node " + index,
};
children.Insert(node);
}
Pretty obvious, but I'm trying to add parameters to the nodes with no luck. I've found a workaround, but I don't really like it.
So can you advice?

I might be off here, since I have only used the libember_slim (C version). But in that library a Parameter is not assigned to a node, but it an alternative object. So you would add the parameter as a child to a node: children.Insert(MyParameter);
The parameter should have its own Identifier and similiar properties


Various Plugin Improvements

While I was working on the other PHPStan issue, I was just going to go in here and remove the MAHO_IS_CHILD_PROJECT constant that we ended up not using, but I found some other things to do:

There was a controller class autoloader that we no longer need because of the work in Maho's composer plugin.

Removed references to disableLocalModules.

Deprecated magentoRootPath in favor of a mahoRootDir parameter. Either value can be null and we'll just use the current cwd.

Greatly simplified the phpstan-bootstrap.php file.

Merged extension.neon and extension-mage-autoload.neon into one. You can trigger the latter by setting mahoUseStaticReflection: false in .phpstan.neon

Removed some parameters from extension.neon. Some weren't needed and others were being overridden by Maho's .phpstan.neon anyway.

Note: the callback: 'callable' type alias should be moved to Maho's .phpstan.neon. It seems wrong to hide mistyped errors in the plugin since they can eventually be fixed. These are the changes I made mahocommerce/maho/.phpstan.neon:
diff --git a/.phpstan.neon b/.phpstan.neon
index facbee0ecb..cbe7030d6b 100644
--- a/.phpstan.neon
+++ b/.phpstan.neon
@@ -3,7 +3,7 @@ includes:
     - .phpstan.baseline.neon
     - phar://phpstan.phar/conf/bleedingEdge.neon
 parameters:
-    magentoRootPath: %currentWorkingDirectory%
+    # mahoUseStaticReflection: false
     phpVersion: 80200
     fileExtensions:
         - php
@@ -62,5 +62,6 @@ parameters:
     checkInternalClassCaseSensitivity: true
     treatPhpDocTypesAsCertain: false
     typeAliases:
+        callback: 'callable'
         Cm_RedisSession_Model_Session: 'Mage_Core_Model_Resource_Session'
     tmpDir: var

Note about child projects
While I haven't tested using this plugin in a child project yet, I suspect we will need modify src/Config/MagentoCore.php, which overrides some of the methods in Mage_Core_Model_Config_Base. It will need to use the Maho composer plugin just like we do in the core file. OR, I'm pretty sure you could just disable the static analysis option and we'll load the actual config class and it should work.

Testing
Probably easiest to just cp -R the files into your vendor folder to test.

@fballiano tagging you in case you didn’t see this.

@justinbeaty sorry, I saw it this morning and was wondering why I didn't receive a notification

@justinbeaty this plugin was never tested for child projects so it's no problem ;-)

@justinbeaty this plugin was never tested for child projects so it's no problem ;-)

Yeah, the static reflection mode definitely won’t work, but I think the other mode will. We will fix it later, not a big deal now.
No problem on the delay, I just saw your phpstan version bump this morning and figured you saw this but just making sure.


error: cannot find symbol UIBlock

Is this a bug report?
Yes
Have you read the Installation Instructions?
yes
Environment
    "react": "^16.3.0-alpha.2",
    "react-native": "^0.54.2",
    "react-native-maps": "^0.16.4",

Steps to Reproduce

react-native run-android (works fine for ios)

Expected Behavior
Expected project to build.
Actual Behavior
Received the following errors:
macbook-7:MobileApp meylor$ react-native run-android
Scanning folders for symlinks in /Users/meylor/workspace/MobileApp/node_modules (15ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.
...
:react-native-maps:preBuild UP-TO-DATE
:react-native-maps:preReleaseBuild UP-TO-DATE
:react-native-maps:checkReleaseManifest
:react-native-maps:preDebugAndroidTestBuild UP-TO-DATE
:react-native-maps:preDebugBuild UP-TO-DATE
:react-native-maps:preDebugUnitTestBuild UP-TO-DATE
:react-native-maps:preReleaseUnitTestBuild UP-TO-DATE
:react-native-maps:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:react-native-maps:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:react-native-maps:prepareComAndroidSupportSupportV42400Library UP-TO-DATE
:react-native-maps:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:react-native-maps:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:react-native-maps:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:react-native-maps:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:react-native-maps:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:react-native-maps:prepareComFacebookReactReactNative0201Library UP-TO-DATE
:react-native-maps:prepareComGoogleAndroidGmsPlayServicesBase1024Library UP-TO-DATE
:react-native-maps:prepareComGoogleAndroidGmsPlayServicesBasement1024Library UP-TO-DATE
:react-native-maps:prepareComGoogleAndroidGmsPlayServicesMaps1024Library UP-TO-DATE
:react-native-maps:prepareComGoogleAndroidGmsPlayServicesTasks1024Library UP-TO-DATE
:react-native-maps:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:react-native-maps:prepareReleaseDependencies
:react-native-maps:compileReleaseAidl UP-TO-DATE
:react-native-maps:compileReleaseNdk UP-TO-DATE
:react-native-maps:compileLint UP-TO-DATE
:react-native-maps:copyReleaseLint UP-TO-DATE
:react-native-maps:compileReleaseRenderscript UP-TO-DATE
:react-native-maps:generateReleaseBuildConfig UP-TO-DATE
:react-native-maps:generateReleaseResValues UP-TO-DATE
:react-native-maps:generateReleaseResources UP-TO-DATE
:react-native-maps:mergeReleaseResources UP-TO-DATE
:react-native-maps:processReleaseManifest UP-TO-DATE
:react-native-maps:processReleaseResources UP-TO-DATE
:react-native-maps:generateReleaseSources UP-TO-DATE
:react-native-maps:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:react-native-maps:compileReleaseJavaWithJavac
:react-native-maps:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:15: error: cannot find symbol
import com.facebook.react.uimanager.UIBlock;
                                   ^
  symbol:   class UIBlock
  location: package com.facebook.react.uimanager
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/RegionChangeEvent.java:16: error: no suitable constructor found for Event(int)
    super(id);
    ^
    constructor Event.Event() is not applicable
      (actual and formal argument lists differ in length)
    constructor Event.Event(int,long) is not applicable
      (actual and formal argument lists differ in length)
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:85: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock() {
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:107: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
    if (!contextHasBug(appContext.getCurrentActivity())) {
                                 ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:108: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
      superContext = appContext.getCurrentActivity();
                               ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:111: error: cannot find symbol
      if (!contextHasBug(reactContext.getCurrentActivity())) {
                                     ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:112: error: cannot find symbol
        superContext = reactContext.getCurrentActivity();
                                   ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapMarkerManager.java:119: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapMarkerManager.java:122: error: cannot find symbol
    super.setZIndex(view, zIndex);
         ^
  symbol: method setZIndex(AirMapMarker,float)
Note: /Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
9 errors
:react-native-maps:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-maps:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 11.428 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

This appears to be the same issue as https://github.com/react-community/react-native-maps/issues/2090 , except that I'm not attempting to define a second maven url.

@meylor  "react-native-maps": "^0.16.4",? we're at 0.21.0 now. Try to update please.

@rborn okay, upgraded to "react-native-maps": "^0.21.0", as well as the gradle classpath to 3.0.1.
I had tried upgrading before, but still seeing the same issue after upgrade.
macbook-7:MobileApp meylor$ react-native run-android
Scanning folders for symlinks in /Users/meylor/workspace/MobileApp/node_modules (10ms)
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

...

> Task :react-native-maps:compileDebugJavaWithJavac FAILED
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:18: error: cannot find symbol
import com.facebook.react.uimanager.UIBlock;
                                   ^
  symbol:   class UIBlock
  location: package com.facebook.react.uimanager
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/RegionChangeEvent.java:15: error: no suitable constructor found for Event(int)
    super(id);
    ^
    constructor Event.Event() is not applicable
      (actual and formal argument lists differ in length)
    constructor Event.Event(int,long) is not applicable
      (actual and formal argument lists differ in length)
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:89: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock() {
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:152: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapModule.java:187: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:119: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
    if (!contextHasBug(appContext.getCurrentActivity())) {
                                 ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:120: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
      superContext = appContext.getCurrentActivity();
                               ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:123: error: cannot find symbol
      if (!contextHasBug(reactContext.getCurrentActivity())) {
                                     ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java:124: error: cannot find symbol
        superContext = reactContext.getCurrentActivity();
                                   ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapMarkerManager.java:121: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/meylor/workspace/MobileApp/node_modules/react-native-maps/lib/android/src/main/java/com/airbnb/android/react/maps/AirMapMarkerManager.java:124: error: cannot find symbol
    super.setZIndex(view, zIndex);
         ^
  symbol: method setZIndex(AirMapMarker,float)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-maps:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
106 actionable tasks: 3 executed, 103 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Be sure gradle change is in both places as per https://github.com/react-community/react-native-maps/pull/2096#issuecomment-376877553 and run a gradle clean in your android folder.


Relationship Field sort_field must be unique

The belongsToMany Field Type Relationship get's confused if you define a sort_field in a pivot table with the same name as a column in one of the Model's tables.
So for example:
Schemas:
projects(id, title, body, image, position)
tags(id, title)
project_tag(id,  position)
Models:
Tag belongsToMany Project
Project belongsToMany Tag
Administrator model config file:
'edit_fields' => array(
'projects' => array(
'title' => 'Projects',
'type' => 'relationship',
'name_field' => 'title',
'sort_field' => 'position'
),
),
This will cause the sorting to not work due to the fact that the "position" in the pivot table is the same name as "position" in the Project table.

I would need to see the full admin configs and your models, I am not sure where the problem lies with what you have given.

Sure thing, I'm happy to help reproduce the issue. What format would be most convenient for you?
Would a skeleton structure of Models, Migrations, and Config files (same as the /examples directory) suffice?

just post here the raw code and I will take a look.  give me the 2 models, and the admin config giving you the issue.

any movement on this?

yes, please find the models and config required to reproduce the issue attached
Laravel-Administrator-issue-947.zip

if this is a confirmed bug and you're accepting pull requests, i'd be happy to try and provide a fix

this issue is still labeled as not having enough information, let me know if you need anything additional


GPX metadataType

Hi Tom,
over years I come back to ask myself this question: Is it valid to have a properties element in an geoJSON featureCollection?
So first of all here's just a friendly reminder:
• RFC 7946 - Extending GeoJSON

6.1.  Foreign Members
Members not described in this specification ("foreign members") MAY be used in a GeoJSON document.  Note that support for foreign members can vary across implementations, and no normative processing model for foreign members is defined.  Accordingly, implementations that rely too heavily on the use of foreign members might experience reduced interoperability with other implementations.
For example, in the (abridged) Feature object shown below
{
  "type": "Feature",
  "id": "f1",
  "geometry": {...},
  "properties": {...},
  "title": "Example Feature"
}

the name/value pair of "title": "Example Feature" is a foreign member.  When the value of a foreign member is an object, all the descendant members of that object are themselves foreign members.

• GPX 1.1 Schema Documentation - metadataType
<xsd:complexType name="metadataType">
  <xsd:sequence>
    <-- elements must appear in this order -->
    <xsd:element name="name" type="[xsd](https://www.topografix.com/GPX/1/1/#ns_xsd):string" minOccurs="0"/>
    <xsd:element name="desc" type="[xsd](https://www.topografix.com/GPX/1/1/#ns_xsd):string" minOccurs="0"/>
    <xsd:element name="author" type="[personType](https://www.topografix.com/GPX/1/1/#type_personType)" minOccurs="0"/>
    <xsd:element name="copyright" type="[copyrightType](https://www.topografix.com/GPX/1/1/#type_copyrightType)" minOccurs="0"/>
    <xsd:element name="link" type="[linkType](https://www.topografix.com/GPX/1/1/#type_linkType)" minOccurs="0" maxOccurs="unbounded"/>
    <xsd:element name="time" type="[xsd](https://www.topografix.com/GPX/1/1/#ns_xsd):dateTime" minOccurs="0"/>
    <xsd:element name="keywords" type="[xsd](https://www.topografix.com/GPX/1/1/#ns_xsd):string" minOccurs="0"/>
   <xsd:element name="bounds" type="[boundsType](https://www.topografix.com/GPX/1/1/#type_boundsType)" minOccurs="0"/>
   <xsd:element name="extensions" type="[extensionsType](https://www.topografix.com/GPX/1/1/#type_extensionsType)" minOccurs="0"/>
  </xsd:sequence>
</xsd:complexType>

Motivation
Mainly, make it easier to access the root gpx file <name>.
Right now, others can achieve this more or less by doing like so:
// Ref: https://github.com/Raruto/leaflet-elevation/blob/e0c68cba9a71d140e4c5a4179c51ae34588b7327/src/control.js#L965-L973

let xml  = (new DOMParser()).parseFromString(data, "text/xml");
let type = xml.documentElement.tagName.toLowerCase(); // "kml" or "gpx"
let name = xml.getElementsByTagName('name');
if (xml.getElementsByTagName('parsererror').length) {
  throw 'Invalid XML';
}
if (!(type in toGeoJSON)) {
  type = xml.documentElement.tagName == "TrainingCenterDatabase" ? 'tcx' : 'gpx';
}
let geojson  = toGeoJSON[type](xml);
geojson.name = name.length > 0 ? (Array.from(name).find(tag => tag.parentElement.tagName == "trk") ?? name[0]).textContent : '';

Draft implementation
Essentially, augmenting the FeatureCollection interface by providing a new property: metadata
• lib/gpx.ts#L181-L197
import { extractMetadata } from "./gpx/metadata";

...

export function gpx(node: Document): FeatureCollection {
  return {
    type: "FeatureCollection",
    features: Array.from(gpxGen(node)),
    metadata: extractMetadata(node),
  };
}

• lib/gpx/metadata.ts
Almost the same as: lib/gpx/properties.ts#L1-L36
NB some functions parameters types invoked in here must be double-checked (ref: Element and Document interfaces)
import { $, getMulti, nodeVal } from "../shared";

export function extractMetadata(node: Document) {
  const properties = getMulti(node, [
    "name",
    "desc",
    // "author",
    // "copyright",
    "time",
    "keywords",
    // bounds
  ]);

  const extensions = Array.from(
    node.getElementsByTagNameNS(
      "http://www.garmin.com/xmlschemas/GpxExtensions/v3",
      "*"
    )
  );
  for (const child of extensions) {
    if (child.parentNode?.parentNode === node) {
      properties[child.tagName.replace(":", "_")] = nodeVal(child);
    }
  }

  const links = $(node, "link");
  if (links.length) {
    properties.links = links.map((link) =>
      Object.assign(
        { href: link.getAttribute("href") },
        getMulti(link, ["text", "type"])
      )
    );
  }

  return properties;
}

lib/index.d.ts
I'm not very knowledgeable about typescript, anyway I think it could result in something like this:
// Based on https://stackoverflow.com/questions/42262565/how-to-augment-typescript-interface-in-d-ts

import * as geojson from 'geojson';

declare module 'geojson' {
  namespace GeoJSON {
    export interface FeatureCollection<G extends geojson.Geometry | null = geojson.Geometry, P = geojson.GeoJsonProperties> extends geojson.GeoJsonObject {
      metadata?: {
        name?: string;
        desc?: string;
        author?: {
          name?: string;
          email?: string;
          link?: {
            href: string;
            text?: string;
            type?: string;
          };
        };
        copyright?: {
          author?: string;
          year?: string;
          license?: string;
        };
        time?: string;
        keywords?: string;
        bounds?: [number, number, number, number]
        extensions?: any;
      };
    }
  }
}

I'm really sorry, but at the moment I can't say how much additional re-work might be needed to integrate it in the generation of current dist/index.d.ts file.
Hoping that somehow these notes can be useful
👋 Raruto

Personally I think I'd prefer a separate method, like toGeoJSON.gpxMetadata() -> metadata object rather than putting properties on FeatureCollection. I still think that putting properties on a FeatureCollection is technically allowed but practically dangerous: as soon as you send that GeoJSON through a transformation step like Turf.js, the extra properties will be removed. They won't be accessible via most GeoJSON editors or through map libraries.
I think it just makes more sense to have a separate process to get metadata, and if people strongly want to combine that metadata with their FeatureCollection object, they can do so with { ...featureCollection, ...metadata }.

Based on: https://gis.stackexchange.com/a/415412

You can insert a Polygon feature without any coordinates and set your properties as you like:
{
 "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
        ]
      },
      "properties": {
        "description": "This is the geometry for..."
      }
    },
    {
      // Other features
    }
  ]
}

Maybe something like this would be even more easier to store and therefore portable (also when it comes to snapshot testing):
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [ ]     // eventually populated by https://www.topografix.com/GPX/1/1/#type_boundsType
      },
      "properties": {
        "_gpxType": "metadata" // everything else related to https://www.topografix.com/GPX/1/1/#type_metadataType
        "name": "...",
        "desc": "...",
        "author": {
            "name": "...",
            "email": "",
            "link": {
               "href": "...",
               "text": "...",
               "type": "...",
            }
        },
        "copyright": {
          "author": "...",
          "year": "...",
          "license": "..."
        },
        "time": "...",
        "keywords": "...",
        "extensions": ??
    },
    {
      // Other features
    }
  ]
}

Not really sure if these property names make sense:

"_gpxType": "metadata" --> similarly to what was already done to distinguish <rte> and <trk> tags
"extensions": ?? --> probably a more complex structure (right now, I don't remember what's the current gpx extensions specfication..)

but that's just to give you a quick idea.
Related info:

https://github.com/placemark/togeojson/blob/d395dde55b4d05fa11145b0a90a31fc466798c9b/lib/__snapshots__/index.test.ts.snap#L12768-L12811
https://github.com/placemark/togeojson/blob/d395dde55b4d05fa11145b0a90a31fc466798c9b/lib/gpx.ts#L181-L191

👋 Raruto

A vote in favor of the gpxMetadata() route (instead of using a foreign member).  Attached is a sample file with a custom namespace in the metadata extensions for testing.
<gpx version="1.1" creator="deepzoom"
    xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"
    xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
    xmlns:opencpn="http://www.opencpn.org"
    xmlns:deepzoom="http://www.deepzoom.com">
  <metadata>
    <name>A DeepZoom Trip</name>
    <time>2024-11-24T07:59:30Z</time>
    <extensions>
      <deepzoom:trip>A DeepZoom Trip Alt</deepzoom:trip>
    </extensions>
  </metadata>
  <rte>
    <name>Route 1</name>
    ...

deepzoom.txt


Update using-a-configurable-inf-file.md

Added some additional exceptions to universal compliant registry hives

@NabilFates,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

Thanks, Nabil, I'll review...

@NabilFates please review my minor update and let me know if it's still accurate.  Thanks!