Wasm: WASI support - start from WASIp1 or skip to WASIp2?

summary: ~I believe starting with WASIp1 and then WASp2 in future, is the right approach.~ https://github.com/scala-js/scala-js/issues/5080#issuecomment-2488309511
This is a sub-issue of https://github.com/scala-js/scala-js/issues/4991
As noted in https://github.com/scala-js/scala-js/issues/4991#issuecomment-2404093035, to port Scala.js libraries to stand-alone Wasm runtime, WASI support is needed:  WASI provides a standardized way for Wasm modules to interact with the host system such as file access, networking, and clock functions.
WASI currently has two versions: WASI preview 1 (wasip1) and WASI preview 2 (wasip2), which version should we choose?
WASIp1 and WASIp2

WASIp1

Supported by many VMs and considered stable/freeze.
Provides access to WASI functions via Wasm imports.
The interface uses only Wasm 1.0 types like i32, with data primarily exchanged via linear memory.
WASIp1 does not define interfaces for opening sockets. [^wasip1-sock]

Instead, for example, WasmEdge enables HTTP communication through its own custom WASI Preview1 extensions and languages have to provide SDK on it[^go-sdk], which makes it dependent on the host.

[^wasip1-sock]: Interfaces for handling opened sockets are defined https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-sock_acceptfd-fd-flags-fdflags---resultfd-errno
[^go-sdk]: https://go.dev/blog/wasi

WASIp2

An implementation based on the Wasm Component Model proposal which introduces an entirely new binary format, encompassing Core Wasm within its structure.
Includes HTTP-related interfaces wasi:http
Interfaces are defined using WIT proposed by the Component Model, and we can generate bindings from WIT using tools like wit-bindgen (once we support it for Scala.js). Component Model provides richer language-independent types such as string and list, not limited to types like i32.
Currently supported only by wasmtime, with wasmedge in development. Other VMs have yet to begin implementation. (wazero doesn't have plan to implement until Component Model is standarized)
On the language side, Rust recently (October 2024) introduced WASI Preview2 as a target in version 1.82.0 (previously relying on an adapter for Preview1). Other languages have not yet added support.

Start from WASIp1 or skip to WASIp2?
So we have two options to support WASI:
Implementing with WASI Preview1 and Supporting WASI Preview2 in the Future

⭕ Since WASIp1 is supported by many VMs, Scala's Wasm binaries would become usable in a wide range of environments.

With support for WasmGC and WasmEH, runtimes like WAMR, wazero, Wasmkit, and chicory could potentially be used in the future.

❌ Since WASIp1 does not define interfaces for opening sockets. We'll have to implement some SDKs, for example WASI extension of WasmEdge.
❌ If WASIp2 becomes the mainstream standard in the future, maintaining implementations for both Preview1 and Preview2 could become burdensome, requiring kinda double the effort.

Skipping WASI Preview1 and Supporting WASI Preview2 Only

⭕ If WASI Preview2 becomes the mainstream standard in the near future, the effort required to implement Preview1 can be avoided.
⭕ Since schemas are defined with WIT, there's no need to hardcode all WASI Preview1 commands into the library; it’s sufficient to create a binding generator.

(Technically, WASI Preview1 also has a similar schema system called witx).

⭕ HTTP interfaces are defined.
❌ Currently, only wasmtime supports WASI Preview2. While wasmedge is making gradual progress, it is uncertain whether other VMs will adopt support in the near future.
❌ Supporting WASI Preview2 also requires implementing the Component Model, and Wasm Component Model is still in Phase1 on Nov 2024.

I believe it might take a very long time to stabilize, struggle to gain community adoption, or undergo significant changes.

My personal take
It might take extra effort in a long run, but I believe starting with WASIp1 and then WASp2 in future, is the right approach.
WASI preview 2 offers features like an HTTP interface and Component Mode brings various benefits.
Benefits include

eliminating the need for custom SDKs for each interface thanks to WIT IDL and bindgen
Reducing the attack surface (e.g., in case a specific component is attacked) by restricting components from importing/exporting memory
And future support for async capabilities.

However, the Component Model Proposal seems not aimed at incrementally addressing the issues of core Wasm. Instead, it defines a completely new binary format and aims to establish an entirely new ecosystem. It’s an ambitious proposal where multiple topics such as module-linking, interface-types, async, dynamic linking, and link-time virtualization are discussed under a single proposal.
Because of this large scope, I expect the specification to take a long time to stabilize, and for the community to adapt cautiously. While it’s definitely a fascinating proposal, I think the focus should first be on supporting WASI preview 1 to create something that works across a broad range of environments.
And then, In the future (or perhaps in parallel) we can move on to support WASI preview 2 and the Component Model.
Memory related features
To support WASI1, Scala.js needs to implement features such as (1) allocating memory on Wasm linear memory, (2) performing load/store operations on the allocated memory, and (3) defining functions that import WASI functionality into Wasm using annotations like @WasmImport.
I’ve implemented prototypes for the first two features here: (https://github.com/scala-wasm/scala-wasm/pull/4). (If we aim to merge this into the Scala.js upstream in future, the IR will need to be carefully designed though).
These features will likely also be useful for supporting WASIp2 and the Wasm Component Model, because some interfaces between components in the Wasm Component Model pass data through linear memory or fall back to using memory for data if there are too many arguments.

I just talked with @sjrd
WASIp1 is indeed currently supported by many VMs, and WASIp2 is not. However, supporting WASIp1 would require adding nodes to Scala.js IR for low-level operations such as memory allocation, deallocation, and store/load operations (and this would enable calling WASI functions within the library).
However, exposing such low-level operations in the "userland" goes against the design philosophy of the Scala language.
On the other hand, while WASIp2/Component Model is currently supported by only a wasmtime, it defines higher-level data types through WIT and data conversion rules via CanonicalABI. By designing the IR based on WIT, the serialization/deserialization details (CanonicalABI) can be embedded into the linker backend. This avoids exposing low-level operations like memory manipulation to end-users or the IR.
Therefore, it would be good to at least design Scala.js IR based on WIT, and then either lower it to WASIp2 or somehow find a hacky way to lower it to WASIp1.
Note that, WASIp1 comes with witx, a schema definition language that seems to be a predecessor to WIT, which could be a good reference.

FWIW: It feels to me that we might need to take a step back and see how we can iterate on WASM support without impacting the Scala.js core stability. Otherwise WASM support will likely be hindered by not being able to iterate quickly enough.
Maybe we need some experimental IR facility that allows us to isolate these things.

I think it's possible to experiment in a fork for a while. We don't need to have an ecosystem of published libraries until we get pretty confident that we have something solid. At that point we can reconsider.

I'm going to close this issue since we've decided on the approach for the PoC for the time being.
As mentioned, we will proceed with implementing WASI support in the fork. (https://github.com/scala-wasm/scala-wasm for now). I plan to open a new issue to discuss the design of WASI/Component Model support. Should I create it in this repository or the forked one?

Should I create it in this repository or the forked one?

IMO language design issues can go into this repository, even if Wasm-only.


fixes #5724: compare normalized file paths

Impact

[x] Bug fix (non-breaking change which fixes expected existing functionality)
[ ] Enhancement/New feature (adds functionality without impacting existing logic)
[ ] Breaking change (fix or feature that would cause existing functionality to change)

Description
fixes #5724
To handle previous changeset deployed with 4.6.0 <= liquibase < 4.23.1; where filename contains relatives paths , this PR now compares filenames of incoming changeset and already executed changeset in the same way.

Things to be aware of

Things to worry about
Check current PR #5681 which impact the same code.

Additional Context

@jgarec thanks for the detailed issue and PR . I ran some tests and it failed on Windows, so I pushed some reordering to your fix and now it seems fine.
@Alf-Melmac this PR also fixes https://github.com/liquibase/liquibase/issues/5681 . I copied your new test from https://github.com/liquibase/liquibase/pull/5682 to this branch and it works as now we remove the classpath and : from the string as it was before. I also managed to reproduce your issue from https://github.com/Alf-Melmac/liquibase-issue-changeset-with-classpath and using this branch I get now: ERROR: relation "test_table" already exists.
If both of you could give this PR another round of test I would be grateful.

@filipelautert Thanks! The removal of Paths.get looks promising. I'll check against the production setup tomorrow.

@filipelautert, Still ok for me with your fix 👍

Can confirm that it also works in the actual project 👍


space dragon traitor in custody

i dont know how

pretty sure they rolled sleeper somehow, even though this is supposed to be fixed and not happen in the first place

Is it possible it was a syndicate who later got a space dragon by ghosting or something

they did not roll sleeper
Reproduction:

roll traitor
die
win space dragon raffle
ghostroles like loneops and space dragon re-use the mind, so you'll have both traitor and dragon objectives
if your old body was arrested, then you'll appear "in custody"

so just create new mind for space dragon ghostrole

The syndicate are hiring space dragons now!?!

ghostroles like loneops and space dragon re-use the mind, so you'll have both traitor and dragon objectives

same goes for space ninja


[Arc]...

Extension
https://raycast.com/the-browser-company/arc
Description
Error:
SyntaxError: Unexpected token u in JSON at position 6404
    at JSON.parse (<anonymous>)
    at Object.E5 [as current] (/Users/loekbosman/.config/raycast/extensions/606e26d8-b3c5-4760-8001-dccce1b872c4/search-tabs.js:87:20)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps To Reproduce
search within tabs
Current Behaviour
No response
Expected Behaviour
No response

Hi @loekbosman 👋
Is there any weird characters in your tab names at the moment?

Are emoji's weird?
On Mon, Aug 07, 2023 at 14:50:32, Per Nielsen Tikær < @.*** > wrote:

Hi @ loekbosman ( https://github.com/loekbosman ) 👋
Is there any weird characters in your tab names at the moment?
—
Reply to this email directly, view it on GitHub (
https://github.com/raycast/extensions/issues/7829#issuecomment-1667799393
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/ASQY5F4U554C56UEH7UGCUTXUDQBRANCNFSM6AAAAAA3G2REU4
).
You are receiving this because you were mentioned. Message ID: <raycast/extensions/issues/7829/1667799393
@ github. com>

@loekbosman  - I wasn't able to reproduce this bug, even with emoji's in the title. Do you have some of your tab titles that I can use to reproduce the error?

Hi,
I just reinstalled the extension, I instantly get this error.
Some of the tabs open:
On Tue, Aug 08, 2023 at 03:15:31, hugo < @.*** > wrote:

@ loekbosman ( https://github.com/loekbosman ) - I wasn't able to reproduce
this bug, even with emoji's in the title. Do you have some of your tab
titles that I can use to reproduce the error?
—
Reply to this email directly, view it on GitHub (
https://github.com/raycast/extensions/issues/7829#issuecomment-1668769113
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/ASQY5F37RJX6FDJTQU24D43XUGHLHANCNFSM6AAAAAA3G2REU4
).
You are receiving this because you were mentioned. Message ID: <raycast/extensions/issues/7829/1668769113
@ github. com>

I have the same issue:
Error:
SyntaxError: Unexpected token  in JSON at position 7650
    at JSON.parse (<anonymous>)
    at Object.E5 [as current] (/Users/maurelian/.config/raycast/extensions/606e26d8-b3c5-4760-8001-dccce1b872c4/search-tabs.js:89:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I have a ton of tabs (that's what Arc is for after all), but I looked for weird characters, and closed a lot of tabs and cannot get it to work.
I did notice the the position number given seems to always decrease when I close a tab, which suggests to me that the unexpected token is at the end.
How would one go about getting this JSON string out?

Maybe someone could update the title of this issue to make it more descriptive? Would help me to find and check-in on it occasionally.

Do you know how to Fork an extension @maurelian? If so you should be able to npm run dev and find the location in the code


[MINOR]: Use arrow take_arrays, remove datafusion take_arrays

Which issue does this PR close?

Closes #.
Rationale for this change
In the PR, we moved this util under the arrow-rs. This PR replaces  take_arrays util function in Datafusion with arrow util.

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Thanks @akurmustafa


Bug: ImageField not working

Describe the bug
KeyError: 'path' thrown when uploaded image to an object.
To Reproduce
I am working on a project with FastAPI. To create the administrator panel, I am using Starlette Admin and everything worked just fine. However, I needed to upload a single image to each instance of a class called Facility. That's why I followed this tutorial and the rest of the documentation to make it happen. The upload goes well but when I try to edit the instance or view its details a 500 error is thrown. Here it is the full error trace:
Traceback (most recent call last):
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/anyio/streams/memory.py", line 98, in receive
    return self.receive_nowait()
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/anyio/streams/memory.py", line 93, in receive_nowait
    raise WouldBlock
anyio.WouldBlock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 78, in call_next
    message = await recv_stream.receive()
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/anyio/streams/memory.py", line 118, in receive
    raise EndOfStream
anyio.EndOfStream

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
    return await self.app(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/fastapi/applications.py", line 292, in __call__
    await super().__call__(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/sessions.py", line 86, in __call__
    await self.app(scope, receive, send_wrapper)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/cors.py", line 83, in __call__
    await self.app(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 443, in handle
    await self.app(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 108, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/contrib/sqla/middleware.py", line 28, in dispatch
    return await call_next(request)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
    raise app_exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 108, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/auth.py", line 286, in dispatch
    return await call_next(request)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 84, in call_next
    raise app_exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/base.py", line 70, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/base.py", line 414, in _render_edit
    "obj": await model.serialize(obj, request, RequestAction.EDIT),
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/views.py", line 538, in serialize
    obj_serialized[field.name] = await self.serialize_field_value(
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/views.py", line 497, in serialize_field_value
    return await field.serialize_value(request, value, action)
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/contrib/sqla/fields.py", line 38, in serialize_value
    return _serialize_sqlalchemy_file_library(
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/starlette_admin/contrib/sqla/fields.py", line 59, in _serialize_sqlalchemy_file_library
    path = item["path"]
  File "/home/ismael/.cache/pypoetry/virtualenvs/project-backend-qebpIpl6-py3.10/lib/python3.10/site-packages/sqlalchemy_file/base.py", line 15, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'path'

Environment (please complete the following information):

Starlette-Admin version: 0.11.2
SQLAlchemy-File version: 0.6.0
FastAPI version: 0.103.2
ORM/ODMs: SQLAlchemy (v2.0.21)

I have more packages but I thinkg these are the most important. However, if you need more information please let me know.
Additional context
This issue is not exactly of Starlette-Admin, but since @jowilf is also the creator of SQLAlchemy-File I was hoping you could help me.
I would really appreciate your help with this problem.

Can you provide a minimal example that reproduces the bug? This issue can only occur if you modify (outside sqlalchemy) the column containing the file information in the database.

Thanks for your response. I will create a minimal example where you can reproduce the bug.
As to this issue, I do not modify outside sqlalchemy the column value. What I do is create an instance and if I go to the database manager (for example, adminer) you can see the content of the column with all the attributes the ImageField has loaded into it. However, if I go to details page of this instance on the starlette-admin page, the above error occurs (also when I try to edit them).
I will let you know as soon as I have the repo working.

When creating the minimal example, I discovered the bug is not present, so there must be differences to my actual project that is making this bug. I found that on my project, the Alembic migration does not change the image attribute from string to json as it does on this repo.
However, as I say on the README, there I have another issue that is related to the edit and view options. I think it must be related with the primary keys or something, because it tries to go to an undefined route. Besides, the relationship between User and Facility here is not working as expected, because you can't add any user to any relationship as it is specified on the code.
Shall I create another bug or change this one?
I would really appreciate your help through this issue. I will continue looking why on my other project the imagefield is throwing this error.


Fix prepared statement parameter handling

please have a look at the commit messages for explanation
the current implementation does not verify that all parameters for the prepared
statement are set
I also front loaded the check into addBatch since once a statement/command is added it becomes immutable so therefore it doesn't make any sense to wait till execution for that check.
this allows to keep the memory of the bitset constant == paramCount since we only need to validate
the current statement/command since previous statements/commands are guaranteed ot be valid

This fixes #96 and #129 is no longer needed
@xerial is there an issue with the pull request or just time constrained at the moment?
Thank you for your work.

LGTM. Sorry about the delay and thanks for addressing the long standing issue!


feat: Security context for OpenShift

Description
OpenShift does not allow pods to run without a proper seccontext set.
The pre/post jobs had no seccontext set, and the pods failed to run.
I've added the missing seccontext for the jobs and provided the SecContext changes in the values.yaml.
Note:
OpenShift generates a unique UID per namespace. It is recommended to leave it instead of providing a hardcoded UID 25000.

Hey Tomer,
Thanks for the PR! but this doesn't seem to run on a local Minikube
I'm getting Error: container has runAsNonRoot and image will run as root
This is probably due to the removal of the runAsUser hardcoded UID

Hi @shalev007,
The changes here are meant to run only in OpenShift. I have discussed those changes with @noaabarki .


Fix Keil packed compilation error.

After the recent approach with Clearable and Equatable classes, there are some errors.
When building with Keil,  there are compilation errors like the example below:
error:  #1308: Base class "ot::Equatable<ot::Mac::ExtAddress>" of __packed class "ot::Mac::ExtAddress" must be __packed
The error occurs if Clearable or Equatable is a base class for a packed class.
Keil requires that all base classes of a packed class have to be packed.
Below I presented ways to deal with that problem:

Make classes Clearable and Equatable packed.
After during so 2 types of errors in IAR compilation (Keil compilation is fixed) appear:

i)
no instance of overloaded function "ot::Ip6::NetifUnicastAddress::GetNext" matches the argument list and object (the object has type qualifiers that prevent a match)             object type is: ot::Ip6::NetifUnicastAddress const __packed
...\src\core\net\netif.hpp(106) : Error[Pe167]: argument of type "ot::Ip6::NetifUnicastAddress __packed *" is incompatible with parameter of type "ot::Ip6::NetifUnicastAddress *"
...\src\core\net\netif.hpp(159) : Error[Pe513]: a value of type "ot::Ip6::NetifMulticastAddress __packed *" cannot be assigned to an entity of type "otNetifMulticastAddress const *"
The solution is to make struct otNetifAddress and struct otNetifMulticastAddress from ip6.h packed.
Then error
 ...\src\ncp\ncp_base_mtd.cpp(1625): error:  #433: qualifiers dropped in binding reference of type "std::uint8_t &" to initializer of type "__packed std::uint8_t"
appers but it can be easily resolved by creating a local variable and passing it to ReadUint8().
ii)
Several errors like that: src\core\net\ip6_address.cpp(48) : Error[Pe147]: declaration is incompatible with "__interwork __softfp bool ot::Ip6::Address::IsUnspecified() const" (declared <SRCREF line=116 file="...\src\core\net\ip6_address.hpp">at line 116 of "...\src\core\net\ip6_address.hpp"</SRCREF>)
I did not found a good solution to this.

Remove packed from all classes that inherit from Clearable or Equatable.

Doing so requires a lot of changes and I end up with two types of errors (with GCC compiler, did not check Keil or IAR):
i)
.../src/core/thread/network_data_tlvs.hpp:343:90: error: cast from 'uint8_t* {aka unsigned char*}' to 'ot::NetworkData::HasRouteEntry*' increases required alignment of target type [-Werror=cast-align]          return reinterpret_cast<HasRouteEntry *>(GetValue() + (i * sizeof(HasRouteEntry)));
Error occurs in every place where uint8_t pointer is casted to pointer of non-packed class.
ii)
.../src/core/thread/network_diagnostic_tlvs.hpp:695:22: error: ignoring packed attribute because of unpacked non-POD field 'ot::Mle::RouterIdSet ot::NetworkDiagnostic::RouteTlv::mRouterIdMask' [-Werror]
A lot of changes is required to fix this, so I decided to go another way.

Do not make Clearable and Equatable classes packed for IAR.

This approach is implemented in this PR.

@piotrkoziar another option I was consdiering is to define a packed version (along with unpacked version)  of Clearable/Equatable, and then use the specific base class based on whether the sub-class type itself is packed or not.
I added it in PR  https://github.com/openthread/openthread/pull/5102.
Can you please help check if this addresses the issues on Keil and IAR? Thanks.

@abtink I run build tests on #5102 and there is the same issue as I described in option 1.ii:
...\src\core\net\ip6_address.cpp(67) : Error[Pe147]: declaration is incompatible with "__interwork __softfp bool ot::Ip6::Address::IsUnspecified() const" (declared <SRCREF line=164 file="...\src\core\net\ip6_address.hpp">at line 164 of "...\src\core\net\ip6_address.hpp"</SRCREF>)
There is more errors like this in the build log.
IAR fails at the compilation of functions from ot::Ip6::Address class that are defined in ip6_address.cpp file. (the similar error applies to mac_type.cpp and mle_type.cpp).

Thanks @piotrkoziar for testing.
That's a weird error (not sure if I understand it). Seems like compiler does not think the method declaration and implementation  match (somehow caused with addition of a packed base (template) class?).

@piotrkoziar  do you happen to have any idea what is the error we get from IAR? (why is complier not happy with the decleration?)

@abtink I agree that the implementation and the declaration of class methods do not match after __packed is added to it but I don't know the exact reason for this error. I do not have any ideas on how to fix that right now. I asked IAR technical support about it, but I think that the answer would be rather to change the compiler version (which would not help in my case) than to make some nice adjustments in the code.

@abtink Currently this PR passes all build tests. Clearable and Equatable classes are declared packed only under Keil compiler. Are you ok with this solution?

Thanks @piotrkoziar for your help with this and checking further on IAR error.
I agree that this fix works but I feel it is more of workaround (just for Keil toolchain).
Keil seem to require all base classes of a packed type to also be declared as packed (even if they are empty base classes). I believe this is not required by gcc in the case of empty base class. That said, such a requirement seems reasonable to me and would expect that other embedded tool-chains may require the same. So a solution like in https://github.com/openthread/openthread/pull/5102 which addresses this fully on all tool-chains would be better in my opinion.
That's why I'd say it may be worth trying to understand and fix the IAR error with  https://github.com/openthread/openthread/pull/5102 change. In that PR:

We define a PackedClearable and regular (un-packed) Clearable
If the sub-class type itself is packed, we inherit from PackedClearable, otherwise from the Clearable

The IAR error seems to be related to cpp implementation of ot::Ip6::Address::IsUnspecified() const method not being associated with header file definition.
Error[Pe147]: declaration is incompatible with "__interwork __softfp bool ot::Ip6::Address::IsUnspecified() const" (declared <SRCREF line=164 file="...\src\core\net\ip6_address.hpp">at line 164 of "...\src\core\net\ip6_address.hpp"</SRCREF>)

Here are some observations/theories:

The Ip6::Address class itself is defined as packed.
It already inherits from otIp6Address which is itself packed and IAR toolchain is ok with this before.
In current master it inherits from Clearable (which is not declared as packed) and IAR toolchain again seems fine with this.
The change in the PR is that it now also inherits from PackedClearable which causes the compilation error.
IAR uses the prefix __packed (in OT_TOOL_PACKED_BEGIN) to declare a type as packed (only tool chain currently that uses a prefix OT_TOOL_PACKED_BEGIN and not a suffix `OT_TOOL_PACKED_END).
Maybe in the template definition of PackedClearable the order of __packed matters for the IAR tool-chain

We have template <typename Type> OT_TOOL_PACKED_BEGIN class PackedClearable currently in the PR (first template then __packed)
Maybe chanding the order OT_TOOL_PACKED_BEGIN template <typename Type> class PackedClearable would help address the issue (@piotrkoziar  would you be able to please help check if this may help or not?).

Here is my proposal on how to proceed:

If we can find a way to make https://github.com/openthread/openthread/pull/5102 work on IAR   that would be best way to go.
If we cannot address the IAR error, I would say we adopt the approach in https://github.com/openthread/openthread/pull/5102 but add code to handle IAR as a special-case (adding a workaround for IAR in the code), i.e., we add #if checks and if tool-chain is IAR we declare the PacekdClearable same Clearable (not packed) only under IAR toolchain.

If we need to special-case some tool-chain, I prefer we do for IAR compared to Keil. Keil has a reasonable requirement (of base class of packed type being packed), over the IAR seemingly having a weird limitation/error.

Thoughts?

@abtink Thank you for the analysis. I agree with your points regarding the #5102 and procedure.
Here are my observations:

Regarding the OT_TOOL_PACKED_BEGIN template <typename Type> class PackedClearable: I have already checked and it is not allowed - it produces Error[Pe463]: "template" is not allowed.
Just to make clear, there are errors produced not only for ot::Ip6::Address::IsUnspecified() const implementation but for all method implementations from the Address class.
Removing __packed from Address class did not solve the problem with IAR.
Removing __packed from Address class and from struct otIp6Address did not solve the problem with IAR.
I have tried changing the inheritance order (no effect).
I have also tried to use some typedefs for Address class (no effect).

As it was said, the next actions depend on if the solution to IAR error is found. There are chances (not high in my opinion) that the response from IAR technical support will put some light on the error and allow us to address it. Otherwise, let's adopt the #5102 approach with #ifdef.
It is hard to tell exactly when but I am expecting the answer from the support in the next week (there is some holiday in Sweden at the end of this week). But I have nothing against merging #5102 earlier.

Thanks @piotrkoziar. Seems like you already tested a lot of case.  :)
I added a workaround for IAR toolchain (as a separate commit) in #5102.

This fix is not critical.

As it was said, the next actions depend on if the solution to IAR error is found. There are chances (not high in my opinion) that the response from IAR technical support will put some light on the error and allow us to address it. Otherwise, let's adopt the #5102 approach with #ifdef.
It is hard to tell exactly when but I am expecting the answer from the support in the next week (there is some holiday in Sweden at the end of this week). But I have nothing against merging #5102 earlier.

@piotrkoziar , any updates on this?

As it was said, the next actions depend on if the solution to IAR error is found. There are chances (not high in my opinion) that the response from IAR technical support will put some light on the error and allow us to address it. Otherwise, let's adopt the #5102 approach with #ifdef.
It is hard to tell exactly when but I am expecting the answer from the support in the next week (there is some holiday in Sweden at the end of this week). But I have nothing against merging #5102 earlier.

@piotrkoziar , any updates on this?

Nothing. I do not know if anyone would have this problem right now because there were changes in C++ contribution policy (C++11) - the IAR compiler version that I was using regarding this issue would not handle the code anyway.

@jwhui nothing new. I do not know if anyone would have this problem right now because there were changes in C++ contribution policy (C++11) - the IAR compiler version that I was using regarding this issue would not handle the code anyway.

@piotrkoziar , is this still an issue to address? If not, should we close this PR?

@jwhui nothing new. I do not know if anyone would have this problem right now because there were changes in C++ contribution policy (C++11) - the IAR compiler version that I was using regarding this issue would not handle the code anyway.

@piotrkoziar , is this still an issue to address? If not, should we close this PR?

@jwhui I see it that way: so far we found more like a workaround to an issue that is very unlikely to meet again (after certain commit it would be simply not valid). So yes, I recommend closing the PR.

@jwhui I see it that way: so far we found more like a workaround to an issue that is very unlikely to meet again (after certain commit it would be simply not valid). So yes, I recommend closing the PR.

Thanks, @piotrkoziar


promote MockSource to source package

I'm going to need it for the MultiSource tests.

just minor thing and good to be merged


How can i record rtmp video to mp4 and where can i find the saved video ?

here's my config
const NodeMediaServer = require('./');

const config = {
  rtmp: {
    port: 1935,
    chunk_size: 60000,
    gop_cache: true,
    ping: 30,
    ping_timeout: 60
  },
  http: {
    port: 8000,
    mediaroot: './media',
    allow_origin: '*'
  },
  https: {
    port: 8443,
    key: './privatekey.pem',
    cert: './certificate.pem',
  },
  auth: {
    api: true,
    api_user: 'admin',
    api_pass: 'admin',
    play: false,
    publish: false,
    secret: 'nodemedia2017privatekey'
  },
trans: {
ffmpeg: 'C:/Users/lenovo/Downloads/ffmpeg-20190612-caabe1b-win64-static/bin/ffmpeg.exe',
tasks: [
{
app: 'live',
ac: 'aac',
hls: true,
hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
dash: true,
dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
}
]
}
};

let nms = new NodeMediaServer(config)
nms.run();

i think you need change
ffmpeg: 'C:/Users/lenovo/Downloads/ffmpeg-20190612-caabe1b-win64-static/bin/ffmpeg.exe'

to
ffmpeg: 'C:\\Users\\lenovo\\Downloads\\ffmpeg-20190612-caabe1b-win64-static\\bin\\ffmpeg.exe'

unfortunately, it doesn't work !

how does the config looks like ?!
here's an RTMP test demo  'rtmp://s3b78u0kbtx79q.cloudfront.net/cfx/st/honda_accord'
i have put it in config like this but still cannot get video in media direction !
trans: {
ffmpeg: 'C:\\Users\\lenovo\\Downloads\\ffmpeg-20190612-caabe1b-win64-static\\bin\\ffmpeg.exe',
tasks: [
{
app: 'rtmp://s3b78u0kbtx79q.cloudfront.net/cfx/st/honda_accord',
ac: 'aac',
hls: true,
hlsFlags: '[hls_time=2:hls_list_size=3:hls_flags=delete_segments]',
dash: true,
dashFlags: '[f=dash:window_size=3:extra_window_size=5]'
}
]
}

mediaroot: './media',

This should to be set to something like c:\media in windows /usr/media in linuxe

saved video can be found in media folder in your_root_project/

how to download it from the frontend with authetication e.g IP:8000/media/date-time.mp4?sign=1503458721-80c1d1ad2e0c2ab63eebb50eed64201a

how to download it from the frontend with authetication e.g IP:8000/media/date-time.mp4?sign=1503458721-80c1d1ad2e0c2ab63eebb50eed64201a

You can add an api call to your server to download the video

Can you please share the example


Compilation error when using MartenDB session some times

Maybe 15-20% of the time I get a compilation error in my WolverineHandlers.

Its "random", but happens many times each day, I have tried pre-generating the code to, but the same happens there
My current solution is running codegen and deleting the internal folder over-and-over-again untill it generates without error
It always happens with  Session Factory, no other, and it only happens in WolverineHandlers...
I have tried different sessions, but the same error happens with IDocumentSession as well

Live codegen, 500 exception on reqquest

info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/richard/Projects/happydogs/backend/Web
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: Compilation failures!

      CS1056: Unexpected character '−'
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS1056: Unexpected character '−'
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS0131: The left-hand side of an assignment must be a variable, property or indexer
      CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
      CS8410: 'ISessionFactory': type used in an asynchronous using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.
      CS1061: 'int' does not contain a definition for 'QuerySession' and no accessible extension method 'QuerySession' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'

      Code:

      // <auto-generated/>
      #pragma warning disable
      using Marten;
      using Microsoft.AspNetCore.Routing;
      using Microsoft.Extensions.Logging;
      using Microsoft.Extensions.Options;
      using System;
      using System.Linq;
      using Wolverine.Http;

      namespace Internal.Generated.WolverineHandlers
      {
          // START: GET_api_breeder_breederId_private_litters
          public class GET_api_breeder_breederId_private_litters : Wolverine.Http.HttpHandler
          {
              private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options2;
              private readonly Marten.ISessionFactory _sessionFactory−1214042678;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options1;
              private readonly Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Authorization.DefaultAuthorizationService> _logger;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options3;

              public GET_api_breeder_breederId_private_litters(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options2, [Lamar.Named("lightweightSessionFactory")] Marten.ISessionFactory sessionFactory−1214042678, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options1, Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Authorization.DefaultAuthorizationService> logger, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options3) : base(wolverineHttpOptions)
              {
                  _wolverineHttpOptions = wolverineHttpOptions;
                  _options2 = __options2;
                  _sessionFactory−1214042678 = sessionFactory−1214042678;
                  _options1 = __options1;
                  _logger = logger;
                  _options3 = __options3;
              }

              public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext)
              {
                  var getPrivateBreederLittersDetailsEndpoint = new Happydogs.ReadModels.GetPrivateBreederLittersDetailsEndpoint();
                  var defaultAuthorizationEvaluator = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationEvaluator();
                  var defaultAuthorizationHandlerContextFactory = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationHandlerContextFactory();
                  await using var querySession = _sessionFactory−1214042678.QuerySession();
                  var contactListAuthorizationHandler = new Authentication.ContactListAuthorizationHandler(querySession);
                  var dogAuthorizationHandler = new Authentication.DogAuthorizationHandler(querySession);
                  var breederAuthorizationHandler = new Authentication.BreederAuthorizationHandler(querySession);
                  var memberAuthorizationHandler = new Authentication.MemberAuthorizationHandler();
                  var litterAuthorizationHandler = new Authentication.LitterAuthorizationHandler(querySession);
                  var passThroughAuthorizationHandler = new Microsoft.AspNetCore.Authorization.Infrastructure.PassThroughAuthorizationHandler(_options2);
                  var authorizationHandlerList = new System.Collections.Generic.List<Microsoft.AspNetCore.Authorization.IAuthorizationHandler>{passThroughAuthorizationHandler, litterAuthorizationHandler, memberAuthorizationHandler, breederAuthorizationHandler, dogAuthorizationHandler, contactListAuthorizationHandler};
                  var defaultAuthorizationHandlerProvider = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationHandlerProvider(authorizationHandlerList);
                  var defaultAuthorizationPolicyProvider = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationPolicyProvider(_options1);
                  var defaultAuthorizationService = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationService(defaultAuthorizationPolicyProvider, defaultAuthorizationHandlerProvider, _logger, defaultAuthorizationHandlerContextFactory, defaultAuthorizationEvaluator, _options3);
                  if (!System.Guid.TryParse((string)httpContext.GetRouteValue("breederId"), out var breederId))
                  {
                      httpContext.Response.StatusCode = 404;
                      return;
                  }

                  var results = await getPrivateBreederLittersDetailsEndpoint.Get(querySession, breederId, httpContext.User, defaultAuthorizationService, httpContext.RequestAborted).ConfigureAwait(false);
                  await results.ExecuteAsync(httpContext).ConfigureAwait(false);
              }

          }

          // END: GET_api_breeder_breederId_private_litters

      }

         at JasperFx.RuntimeCompiler.AssemblyGenerator.Generate(String code)
         at JasperFx.RuntimeCompiler.AssemblyGenerator.Compile(GeneratedAssembly generatedAssembly, IServiceVariableSource services)
         at JasperFx.RuntimeCompiler.CodeFileExtensions.InitializeSynchronously(ICodeFile file, GenerationRules rules, ICodeFileCollection parent, IServiceProvider services)
         at Wolverine.Http.HttpChain.<>c__DisplayClass67_0.<BuildEndpoint>b__0()
         at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
         at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
         at System.Lazy`1.CreateValue()
         at Wolverine.Http.HttpChain.<>c__DisplayClass67_0.<BuildEndpoint>b__4(HttpContext c)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
      --- End of stack trace from previous location ---
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Running codegen

make: Entering directory '/home/richard/Projects/happydogs/backend'
cd Web && dotnet run -- codegen write && dotnet run -- codegen test
Building...
/usr/lib64/dotnet/sdk/7.0.110/Microsoft.Common.CurrentVersion.targets(2352,5): warning MSB3243: No way to resolve conflict between "Microsoft.AspNetCore.Authentication, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60" and "Microsoft.AspNetCore.Authentication". Choosing "Microsoft.AspNetCore.Authentication, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=adb9793829ddae60" arbitrarily. [/home/richard/Projects/happydogs/backend/Authentication/Authentication.csproj]
Searching 'JasperFx.CodeGeneration.Commands, Version=<IP_ADDRESS>, Culture=neutral,
PublicKeyToken=null' for commands
Searching 'Weasel.CommandLine, Version=<IP_ADDRESS>, Culture=neutral,
PublicKeyToken=null' for commands
Searching 'Marten.CommandLine, Version=<IP_ADDRESS>, Culture=neutral,
PublicKeyToken=null' for commands
Searching 'Wolverine, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null' for
commands
Searching 'Wolverine.Http.FluentValidation, Version=<IP_ADDRESS>, Culture=neutral,
PublicKeyToken=null' for commands

info: Marten.IDocumentStore[0]
      Exporting Open Telemetry metrics from MartenDb (martendb-event-lag)
info: Wolverine.Runtime.WolverineRuntime[0]
      Exporting Open Telemetry metrics from Wolverine with name Wolverine:HappyDogsApi, version <IP_ADDRESS>

info: Wolverine.Configuration.HandlerDiscovery[0]
      Searching assembly Web, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null for Wolverine message handlers
info: Wolverine.Configuration.HandlerDiscovery[0]
      Searching assembly Wolverine.Http.FluentValidation, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null for Wolverine message handlers
info: Wolverine.Configuration.HandlerDiscovery[0]
      Searching assembly Happydogs, Version=<IP_ADDRESS>, Culture=neutral, PublicKeyToken=null for Wolverine message handlers
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/DogViewProvider1049787704.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/LitterPrivateDetailsViewProvider548354355.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/ContactListViewProvider761927626.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/AuthLitherBreederViewProvider1547965875.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/LitterPrivateDetailsView2Provider434124461.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/BreederViewProvider915566407.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/AuthContactListBreederViewProvider1879701829.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/DeadLetterEventProvider834684974.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/MemberBreederViewProvider1421426539.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/UniqueBreedersViewProvider1537472233.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/DogMemberViewProvider1817888358.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/MemberDetailsViewProvider1044861314.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/LitterPublicDetailsViewProvider317014157.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/MembersViewProvider520352115.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/ImageViewProvider102292557.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/DocumentStorage/UniqueMemberEmailViewProvider1513469953.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/EventStorage.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/MembersProjectionRuntimeSupport13979563.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/MemberBreederProjectionRuntimeSupport459619891.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/DogMemberProjectionRuntimeSupport1773952994.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/DogsProjectionRuntimeSupport472162863.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/BreedersProjectionRuntimeSupport2056150350.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/UniqueBreedersProjectionRuntimeSupport2117150977.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/UniqueMemberEmailProjectionRuntimeSupport118709049.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/ContactListProjectionRuntimeSupport1732702498.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/AuthContactListBreederProjectionRuntimeSupport189536415.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/MemberDetailsProjectionRuntimeSupport2017845546.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/ImageProjectionRuntimeSupport732656763.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/LitterPrivateDetailsProjectionRuntimeSupport271406481.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/LitterPrivateDetails2ProjectionRuntimeSupport51136521.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/LitterPublicDetailsProjectionRuntimeSupport1681270095.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/EventStore/AuthLitterBreederProjectionRuntimeSupport71171051.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeders.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeder_breederId_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeder_breederSlug_public.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_member_memberId_breeder_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_member_memberId_contact_list_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_dogs.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_dog_dogId_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_dog_dogSlug_public.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_member_memberId_dogs_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeder_breederId_private_images.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_litter_litterId_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeder_breederId_private_litters.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_v2_breeder_breederId_private_litters.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_litter_litterId_private_v2.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_breeder_breederSlug_litters_litterSlug_public.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_members.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_member_memberId_private.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_search_v1.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/GET_api_health_tests.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_email.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_location.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_name.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_password.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_roles.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_change_telephone.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_create_upload_asset_token.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_add_uploaded_image.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_remove_uploaded_image.cs
Wrote generated code file to /home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_member_request_pilot_access.cs
...
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(22,64): error CS1056: Unexpected character '−' [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(25,571): error CS1056: Unexpected character '−' [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(32,28): error CS1002: ; expected [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(32,28): error CS1056: Unexpected character '−' [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(32,55): error CS1002: ; expected [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(32,55): error CS1056: Unexpected character '−' [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(42,59): error CS1056: Unexpected character '−' [/home/richard/Projects/happydogs/backend/Web/Web.csproj]
/home/richard/Projects/happydogs/backend/Web/Internal/Generated/WolverineHandlers/POST_api_breeder_change_kennel_name.cs(42,60): error CS1002: ; expected [/home/richard/Projects/happydogs/backend/Web/Web.csproj]

The build failed.

      CS1056: Unexpected character '−'
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS1056: Unexpected character '−'
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS1056: Unexpected character '−'
      CS1002: ; expected
      CS0131: The left-hand side of an assignment must be a variable, property or indexer
      CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
      CS8410: 'ISessionFactory': type used in an asynchronous using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.
      CS1061: 'int' does not contain a definition for 'OpenSession' and no accessible extension method 'OpenSession' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IDocumentSession'
      CS8410: 'ISessionFactory': type used in an asynchronous using statement must be implicitly convertible to 'System.IAsyncDisposable' or implement a suitable 'DisposeAsync' method.
      CS1061: 'int' does not contain a definition for 'QuerySession' and no accessible extension method 'QuerySession' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'
      CS1503: Argument 1: cannot convert from 'Marten.ISessionFactory' to 'Marten.IQuerySession'

      Code:

      // <auto-generated/>
      #pragma warning disable
      using Marten;
      using Microsoft.AspNetCore.Routing;
      using Microsoft.Extensions.Logging;
      using Microsoft.Extensions.Options;
      using System;
      using System.Linq;
      using Wolverine.Http;
      using Wolverine.Runtime;

      namespace Internal.Generated.WolverineHandlers
      {
          // START: POST_api_chat_thread_send_text_message
          public class POST_api_chat_thread_send_text_message : Wolverine.Http.HttpHandler
          {
              private readonly Wolverine.Http.WolverineHttpOptions _wolverineHttpOptions;
              private readonly Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Authorization.DefaultAuthorizationService> _logger;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options2;
              private readonly Wolverine.Runtime.IWolverineRuntime _wolverineRuntime;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options3;
              private readonly Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> _options1;
              private readonly Marten.ISessionFactory _sessionFactory−273681302;

              public POST_api_chat_thread_send_text_message(Wolverine.Http.WolverineHttpOptions wolverineHttpOptions, Microsoft.Extensions.Logging.ILogger<Microsoft.AspNetCore.Authorization.DefaultAuthorizationService> logger, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options2, Wolverine.Runtime.IWolverineRuntime wolverineRuntime, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options3, Microsoft.Extensions.Options.IOptions<Microsoft.AspNetCore.Authorization.AuthorizationOptions> __options1, [Lamar.Named("lightweightSessionFactory")] Marten.ISessionFactory sessionFactory−273681302) : base(wolverineHttpOptions)
              {
                  _wolverineHttpOptions = wolverineHttpOptions;
                  _logger = logger;
                  _options2 = __options2;
                  _wolverineRuntime = wolverineRuntime;
                  _options3 = __options3;
                  _options1 = __options1;
                  _sessionFactory−273681302 = sessionFactory−273681302;
              }

              public override async System.Threading.Tasks.Task Handle(Microsoft.AspNetCore.Http.HttpContext httpContext)
              {
                  var messageContext = new Wolverine.Runtime.MessageContext(_wolverineRuntime);
                  await using var documentSession = _sessionFactory−273681302.OpenSession();
                  var aggregateRepository = new Happydogs.Domain.AggregateRepository(documentSession, messageContext);
                  var thread = new Happydogs.Domain.Chat.Thread();
                  var defaultAuthorizationEvaluator = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationEvaluator();
                  var defaultAuthorizationHandlerContextFactory = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationHandlerContextFactory();
                  await using var querySession = _sessionFactory−273681302.QuerySession();
                  var threadAuthorizationHandler = new Authentication.ThreadAuthorizationHandler(querySession);
                  var contactListAuthorizationHandler = new Authentication.ContactListAuthorizationHandler(querySession);
                  var dogAuthorizationHandler = new Authentication.DogAuthorizationHandler(querySession);
                  var breederAuthorizationHandler = new Authentication.BreederAuthorizationHandler(querySession);
                  var memberAuthorizationHandler = new Authentication.MemberAuthorizationHandler();
                  var litterAuthorizationHandler = new Authentication.LitterAuthorizationHandler(querySession);
                  var passThroughAuthorizationHandler = new Microsoft.AspNetCore.Authorization.Infrastructure.PassThroughAuthorizationHandler(_options2);
                  var authorizationHandlerList = new System.Collections.Generic.List<Microsoft.AspNetCore.Authorization.IAuthorizationHandler>{passThroughAuthorizationHandler, litterAuthorizationHandler, memberAuthorizationHandler, breederAuthorizationHandler, dogAuthorizationHandler, contactListAuthorizationHandler, threadAuthorizationHandler};
                  var defaultAuthorizationHandlerProvider = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationHandlerProvider(authorizationHandlerList);
                  var defaultAuthorizationPolicyProvider = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationPolicyProvider(_options1);
                  var defaultAuthorizationService = new Microsoft.AspNetCore.Authorization.DefaultAuthorizationService(defaultAuthorizationPolicyProvider, defaultAuthorizationHandlerProvider, _logger, defaultAuthorizationHandlerContextFactory, defaultAuthorizationEvaluator, _options3);
                  // Reading the request body via JSON deserialization
                  var (c, jsonContinue) = await ReadJsonAsync<Happydogs.Domain.Chat.SendThreadTextMessageEndpointCommand>(httpContext);
                  if (jsonContinue == Wolverine.HandlerContinuation.Stop) return;
                  var result1 = Web.Middleware.ValidateRequestBodyMiddleware.Validate<Happydogs.Domain.Chat.SendThreadTextMessageEndpointCommand>(c);
                  // Evaluate whether or not the execution should be stopped based on the IResult value
                  if (!(result1 is Wolverine.Http.WolverineContinue))
                  {
                      await result1.ExecuteAsync(httpContext).ConfigureAwait(false);
                      return;
                  }

                  System.Guid threadId = default;
                  System.Guid.TryParse(httpContext.Request.Query["threadId"], System.Globalization.CultureInfo.InvariantCulture, out threadId);
                  // Authorize command
                  var authenticated = await defaultAuthorizationService.AuthorizeAsync(httpContext.User, c.ThreadId, "EditThread");
                  if (!authenticated.Succeeded)
                  {
                      httpContext.Response.StatusCode = 403;
                      return;
                  }

                  // Load Aggregate
                  var aggregate = await aggregateRepository.LoadAsync<Happydogs.Domain.Chat.Thread>(c.ThreadId, httpContext.RequestAborted);
                  if (aggregate is null)
                  {
                      httpContext.Response.StatusCode = 404;
                      return;
                  }

                  // The actual HTTP request handler execution
                  Happydogs.Domain.Chat.SendThreadTextMessageEndpoint.Post(threadId, c, aggregate);

                  // Wolverine automatically sets the status code to 204 for empty responses
                  httpContext.Response.StatusCode = 204;
                  await aggregateRepository.StoreAsync(aggregate, httpContext.RequestAborted);
              }

          }

          // END: POST_api_chat_thread_send_text_message

      }

         at JasperFx.RuntimeCompiler.AssemblyGenerator.Generate(String code)
         at JasperFx.RuntimeCompiler.AssemblyGenerator.Compile(GeneratedAssembly generatedAssembly, IServiceVariableSource services)
         at JasperFx.RuntimeCompiler.CodeFileExtensions.InitializeSynchronously(ICodeFile file, GenerationRules rules, ICodeFileCollection parent, IServiceProvider services)
         at Wolverine.Http.HttpChain.<>c__DisplayClass71_0.<BuildEndpoint>b__0()
         at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
         at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
         at System.Lazy`1.CreateValue()
         at Wolverine.Http.HttpChain.<>c__DisplayClass71_0.<BuildEndpoint>b__4(HttpContext c)
         at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
      --- End of stack trace from previous location ---
         at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
         at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
         at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

I created this makefile command that lets me continue:
find  ./Web/Internal -type f -exec sed -i -E 's/sessionFactory.([[:digit:]]+)/sessionFactory\1/g' {} \;

Basically finds any word that starts with sessionFactory-DIGITS and replaces it with sessionFactoryDIGITS


Action corrupts local rust registry

I tried to run my typical Github action for Kani. Historically, this has never caused any issues for the installation of crates. However, on my recent pushes, cargo seems to no longer be able to find optional registries: https://github.com/nyx-space/hifitime/actions/runs/4399579815/jobs/7704213779 . I am not sure what has happened.

Hi there,
I'm not a rust expert but this comment suggests that sparse registries are used from Rust 1.68 (released last week 2023-03-09). Continuing to look into this

Hi @ChristopherRabotin , it doesn't look like Hifitime uses the Kani Github Action.
In any case, the step that installs the stable Rust toolchain is setting CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse (resetting that variable may work as a patch for now). It seems that it's always failing to compile der using sparse registries, right?

Using the Github Action does not cause the issue: https://github.com/nyx-space/hifitime/actions/runs/4417201736/jobs/7742569934 . Closing, and sorry for opening it before checking that I was indeed using the action.

No worries! I'm glad to see the Kani GitHub Action being useful 😄


error while "Associate Crowdsale address to current account"

If you are reporting a problem with Token Wizard, please include the following information:
Which network did you use? (Mainnet, Kovan, Rinkeby, etc.)
ropsten. i ran a local instance of testrpc using https://github.com/trufflesuite/ganache-cli
If you were able to create it, what is the URL of your crowdsale?
http://<IP_ADDRESS>:3000/
Do you have screenshots showing the problem? Do you see errors in the dev console? If yes, please include a screenshot

If you see errors, please right click on them and "Save as..". Zip saved file and attach it to the Issue.
N/A

I updated https://github.com/poanetwork/token-wizard/wiki/Token-Wizard-Local-Dev-Version with these instructions.

Thanks @fvictorio . This creates another problem. I stopped my ganache. And ran:
npm run ganache
npm run deployRegistry
npm start

I logged out of my metamask. Successfully logged into the private network created by npm run ganache command above.
And on 4th step I get the following error:

My metamask also is giving this problem:

Try disabling and enabling MetaMask (right click in the MetaMask icon, manage extensions, uncheck "Enabled" and then check it again). Then load the private key again and see if that works.

with npm run ganache I am able to deploy zero contracts. so i stopped the ganache which ran after npm run ganache. then ran ganache again (using ganache-cli in my terminal. copied the contract address from ganache into .env file against the key 3 (the key for ropsten) )
With ganache-cli instead of npm run ganache I am atleast able to go till 4 out of 12 contract deployment steps in step4 sucessfully. Not able to successfully deploy the 5th contract as in my first screenshot

Sorry. But what you mean by 'Unlock the account' created by ganache ?

Import the private key in metamask. For example, the private key of the first account is 4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d.

Import the private key in metamask
Yes I was doing that.

To be extra sure, follow these steps in order:
I followed all these steps in order and finally the issue is resolved. All contracts deployed on blockchain run by ganache. Thanks @fvictorio

Another amateur question: i specified 'ropstenin/src/components/Common/config.jsand chose Custom RPC in my Metamask. When I try pressing Invest button to reach crowdsale page I get the following error. If ganache is run usingnpm run ganachewhat network should i fill in/src/components/Common/config.js` and what network I should pick in Metamask ?

Oh, if you want to use a testnet, it should be a lot easier (just npm start and select that testnet in MetaMask, no need to run ganache).
I recommend you don't edit Common/config.js just yet, first make sure that everything works.
Right now the supported testnets are Ropsten, Rinkeby, Kovan and Sokol.

Closing this since it's not an issue. If you still have problems, please go to our gitter channel.

Shall someone want to make token wizard work with ganache, check the instructions here


opens chrome half screen and does not use production version chrome

Is there any way to fix this? I saw a discussion where someone mentioned this same issue and it was said to use "viewpoint". That doesn't seem to fix the issue. Also, I was having my script test playing a video. The chome browser that is opened doesn't seem to have html5 player or silverlight installed. - When I open chrome like normal these videos seem to work fine. Any advice?

try chromeFlags: ['--start-maximized']


unclaimedGas execution result difference

Neo-go's execution results differ from C#
Current Behavior
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "state": "FAULT",
        "gasconsumed": "231485",
        "script": "wh8MDGN1cnJlbnRJbmRleAwUvvIEMUA2KnfBUJnH5kwS9wC2ZdpBYn1bUgwU5THqcjqLpY5TkquLOLfxy/LIGN4SwB8MDHVuY2xhaW1lZEdhcwwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUg==",
        "stack": [
            {
                "type": "Integer",
                "value": "4258708"
            },
            {
                "type": "ByteString",
                "value": "5THqcjqLpY5TkquLOLfxy/LIGN4="
            }
        ],
        "exception": "at instruction 120 (SYSCALL): can't calculate bonus of height unequal (BlockHeight + 1)",
        "notifications": []
    }
}

Expected Behavior
from C#
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "script": "wh8MDGN1cnJlbnRJbmRleAwUvvIEMUA2KnfBUJnH5kwS9wC2ZdpBYn1bUgwU5THqcjqLpY5TkquLOLfxy/LIGN4SwB8MDHVuY2xhaW1lZEdhcwwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUg==",
        "state": "HALT",
        "gasconsumed": "694455",
        "exception": null,
        "notifications": [],
        "stack": [
            {
                "type": "Integer",
                "value": "0"
            }
        ]
    }
}

Steps to Reproduce
curl --location 'https://rpc10.n3.nspcc.ru:10331' \
--header 'Content-Type: text/plain' \
--data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "invokescript",
  "params": ["wh8MDGN1cnJlbnRJbmRleAwUvvIEMUA2KnfBUJnH5kwS9wC2ZdpBYn1bUgwU5THqcjqLpY5TkquLOLfxy/LIGN4SwB8MDHVuY2xhaW1lZEdhcwwU9WPqQLwoPU0OBcSOowWz8qBzQO9BYn1bUg=="]
}'

Not sure why C# allows to calculate it via RPC.

It's useful information for a wallet. People still like the idea of "claim gas!"

Yeah, I know, but the limitation is from https://github.com/neo-project/neo/pull/2841 and it's the same for both nodes.

It needs to be executed on-chain to prove correct/incorrect behavior.


bsd treewide: Run RFC formatter

Description of changes
There is a lot of BSD work happening lately, including moving things around between various files, so I think this is a good time to enforce the new format. Explicitly:

We're getting churn either way
Makes it easier for different people to adopt the same style

Things done

Built on platform(s)

[ ] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)

[ ] sandbox = relaxed
[ ] sandbox = true

[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[ ] Tested basic functionality of all binary files (usually in ./result/bin/)
24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

Add a :+1: reaction to pull requests you find important.

I had wanted to ask the others because I think some things do look worse, but yes I think it is worth it too. Ultimately text is bad, the AST is what matters, and auto-formatting is just a way of "letting go" of what the text looks like.

Is there any reason not to wait for the treewide autoformatting?

@alyssais I wanted to run the formatting on this and the version 14 stuff in order to reduce the diff between them. (As opposed to hand revert some things that don't need to change to save for a future PR.)

can add path to check-nix-format.yml workflow https://github.com/NixOS/nixpkgs/blob/e577daf8ba32782c5ef85b5635733902bbf85e53/.github/workflows/check-nix-format.yml#L32-L44

Okay, makes sense.

(last commit did not change any nix code, ofborg-eval already passed)


SAK-44055 - MVP of IMS Auto Provisioning Code

This branch will live for a while - the spec is still under development and this is demo-level code at this point.  Feel free to review and comment.

I think this is ready to merge...


ClientTrait can accept FetchAuthTokenInterface objects

It may be more usable to have ClientTrait accept a config parameter credentials, which accepts classes implementing Google\Auth\FetchAuthTokenInterface:
use Google\Auth\Credentials\GCECredentials;
use Google\Cloud\Storage\StorageClient;
$storage = new StorageClient([
    'credentials' => new GCECredentials()
])

As opposed to the existing way, which looks like this:
use Google\Auth\Credentials\GCECredentials;
use Google\Auth\Middleware\AuthTokenMiddleware;
use Google\Auth\HttpHandler\HttpHandlerFactory;
use Google\Cloud\Storage\StorageClient;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

$gce = new GCECredentials();
$middleware = new AuthTokenMiddleware($gce);

$stack = HandlerStack::create();
$stack->push($middleware);

$client = new Client([
   'handler' => $stack,
   'auth' => 'google_auth'
]);

$httpHandler = HttpHandlerFactory::build($client);

$storage = new StorageClient([
    'httpHandler' => $httpHandler
])

Hey @bshaffer!
We actually have something very similar to this with the option credentialsFetcher:
use Google\Auth\Credentials\GCECredentials;
use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient([
    'credentialsFetcher' => new GCECredentials()
]);

I'll leave this open as a tracking item to make sure we properly document it.

oh wow!! You guys are always one step ahead. Thanks @dwsupplee


Added configurable Loadbalancer classes

What this PR does / why we need it:
If you have multiple FloatingIPPools and/or FloatingIPSubnets it might be desirable to offer the users logical meanings for LoadBalancers like internetFacing or DMZ instead of requiring the user to select dedicated network or subnet ids at the service object as an annotation.
This PR allows first to configure a set of LoadBalancerClasses on cloud provider level containing FloatingIPPoolId, FloatingSubnetID and/or provisioning subnet ID. At the service level a new annotation has been added to select a dedicated class by name.
CloudProvider Configuration Example:
    [Global]
    auth-url="https://someurl"
    domain-name="mydomain"
    tenant-name="mytenant"
    username="myuser"
    password="mypassword"
    [LoadBalancer]
    lb-version=v2
    lb-provider="f5networks"
    floating-network-id="a57af0a0-da92-49be-a98a-345ceca004b3"
    floating-subnet-id="a02eb6c3-fc69-46ae-a3fe-fb43c1563cbc"
    subnet-id="fa6a4e6c-6ae4-4dde-ae86-3e2f452c1f03"
    create-monitor=true
    monitor-delay=60s
    monitor-timeout=30s
    monitor-max-retries=5
    [LoadBalancerClass "internetFacing"]
    floating-network-id="c57af0a0-da92-49be-a98a-345ceca004b3"
    floating-subnet-id="f90d2440-d3c6-417a-a696-04e55eeb9279"
    [LoadBalancerClass "dmz"]
    floating-subnet-id="a374bed4-e920-4c40-b646-2d8927f7f67b"
    [LoadBalancerClass "office"]
    floating-subnet-id="b374bed4-e920-4c40-b646-2d8927f7f67b"

Service example
apiVersion: v1
kind: Service
metadata:
  annotations:
    loadbalancer.openstack.org/class: internetFacing
  name: nginx-internet
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer

Release note:
Added support for LoadBalancer Classes when using multiple FloatingPool subnets and/or FloatingPool networks

Looks like 2 tests failed for various other reasons here?!?

/retest

i like this idea, +1 when its ready

/ok-to-test

/retest

/lgtm

Can somebody help me with the e2e conformance tests issues here? I don't see any load balancer related issues in the logs. Is the e2e conformance suite currently functional?

Hi @afritzler, our CI is encountering some issues at the moment, the openlab team is working on that.

Thanks @lingxiankong for the info!

/test cloud-provider-openstack-acceptance-test-e2e-conformance

/test cloud-provider-openstack-acceptance-test-e2e-conformance-stable-branch-v1.14

/test cloud-provider-openstack-acceptance-test-e2e-conformance-stable-branch-v1.13

/test cloud-provider-openstack-acceptance-test-e2e-conformance-stable-branch-v1.12

/lgtm

Alright, added documentation on how to use this feature. I guess once this is rolled out, we also need to adjust official docs here https://kubernetes.io/docs/concepts/cluster-administration/cloud-providers/

/test cloud-provider-openstack-format

/retest

/retest


Periodic mesh with other boundaries

This is with reference to what I posted here 205. Please tell me if you want me to delete that comment.
The issue was with reference to the following mesh. Think of it as two cylinders. The inside cylinder is a wall and the outside cylinder is say freestream, meaning two different boundary conditions for the two. In addition I want the z = 0 and z = Lz surfaces to be periodic (I hope the axis makes them clear).

I generated the mesh using GMSH. I have two boundaries "lo" and "hi" which I want to convert to the periodic format. This is a simpler version with only the wall boundary condition.
per_ch.txt
So, first I convert it to MFEM format.
ch.txt
And then use a script to convert lo and hi to periodic and the vertices in the other boundaries are also changed to only have the corresponding periodic vertices. The periodic boundary elements are removed from the boundary definition.
new_ch.txt
So, does this make sense, especially in terms of changing vertices of other boundary elements.

Hi @vikramsg,
This may or may not be an issue, but there are no boundary elements defined on the outer loop of the mesh you attached, so to MFEM it looks like this:

Regarding the periodic mesh -- the new_ch.txt file doesn't quite seem right. If I understand correctly you should have 48 vertices and 8 z-aligned + 12 inner-loop + 48 outer-loop boundary faces (that are currently missing).
All you have to do is pick one of the z surfaces as slave, e.g. z=0, and the other one as master, e.g. z = Lz, delete the boundary elements on z=0 and use replace the vertices on z=0 with the indices of their z=Lz periodic vertex in the description of the volume elements. (Ideally you will renumber the vertices so you have a tight packing of 48, but you can also keep the 64 indices and just not use some of them).
Hope this helps,
Tzanio

Hi, @vikramsg,
It may interest you to know that we have a function that can create a periodic mesh from a valid starting mesh (in serial).  It's not in the master branch of MFEM but you could certainly copy it into your application.  You can find this function in the bravais-dev branch in the files miniapps/common/bravais.?pp.  The function name is MakePeriodicMesh.  It returns a pointer to a new periodic MFEM mesh object.  Its arguments are a standard mesh and a std::vector containing translation vectors (as well as an optional verbosity flag).  The translation vectors are used to identify pairs of nodes where one node lies on a master surface and the other is its counterpart on the slave surface.
Best wishes,
Mark

Direct link to Mark's source: https://github.com/mfem/mfem/blob/bravais-dev/miniapps/common/bravais.cpp#L6864-L7148

Hi @tzanio ,
Thanks for looking it over. I don't know how the outer boundary faces were deleted but sorry for that.  I just did not renumber the vertices.
I will have a look at the @mlstowell mentioned code. Thanks for that.

Hi @vikramsg, were you able to figure this out? -Tzanio

Hi @tzanio. I used code from the branch suggested by @mlstowell . I want to close this but just wanted to know whether there is a good test to figure out whether the periodic boundaries have been placed correctly.

Hi, @vikramsg, you can use the Euler number of the mesh to verify a necessary but not sufficient condition.  Specifically, if all of the mesh boundaries are periodic then the Euler number should be zero.

Another test could be to run Example 9 transporting a "bump" over the periodic boundaries.

Thanks, @mlstowell and @tzanio. I will close this.


Update destination-event-streaming-overview.md

Wanted to put a note as we've been getting a few questions from GTM about how we count event volume streamed out.

We track volume as distinct events streamed out, so if an app has 2 syncs sending out all events the same event will not count as 2 for billing purposes, it will count as 1 no matter the number of syncs setup

Amplitude Developer Docs PR
Description
Describe your changes.
Deadline
When do these changes need to be live on the site?
Change type

[ ] Doc bug fix. Fixes #[insert issue number]. Amplitude contributors include Jira issue number.
[ ] Doc update.
[ ] New documentation.
[ ] Non-documentation related fix or update.

PR checklist:

[ ] My documentation follows the style guidelines of this project.
[ ] I previewed my documentation on a local server using mkdocs serve.
[ ] Running mkdocs serve didn't generate any failures.
[ ] I have performed a self-review of my own documentation.

@amplitude-dev-docs
@caseyamp

@daniel-beer have you got anything to add to this, or can we go ahead and ship?


feat: added translations

added translations for arabic, spanish, french, turkish, russian, added ltr/rtl layout logic

To see the specific tasks where the Asana app for GitHub is being used, see below:

https://app.asana.com/0/0/1206308455467457

@aeschi I have updated the title alignment and reduced the tooltip size on the next button, let me know what you think 👍


Add 'Hub Control Panel' in JupyterLab file menu handbook-authoring-image

Ref: https://2i2c.freshdesk.com/a/tickets/1330
I thought @jupyterlab/hub-extension might be needed but it looks like that's no longer required.  So what package or extension does bring in that 'Hub Control Panel' menu item into JupyterLab?

This is not a super urgent request but more of a "nice-to-have" so that users on the Community Showcase have a consistent experience.


Preload  in dist/index.html are not rendered correctly when setting router.base from module

I am setting the router.base config from a nuxt module for SPA nuxt apps. Starting from v2.15.0, the index.html file in the resulting dist/ directory seems to be built incorrectly. More specifically, it seems the href in the <link rel="preload" href="..." as="script"> contains incorrect URL as it does not include the value of the router.base config. See below for more details.
Versions

nuxt: v2.15.4
node: v15.0.1

Reproduction
Repo: https://github.com/rarief/nuxt-router-base-issue
modules/test-module/index.js
const { resolve } = require("path");

export default function () {
  const { nuxt } = this;

  nuxt.options.router.base = '/app/' // <-- setting router base config here

  console.log(nuxt.options.router.base);
}

nuxt.config.js
export default {
  ssr: false,

  ...

  modules: [
    '~/modules/test-module'
  ],
}

What is Expected?
dist/index.html
  ...
  <link rel="preload" href="/app/_nuxt/92dd6da.js" as="script">
  <link rel="preload" href="/app/_nuxt/36dabdf.js" as="script">
  <link rel="preload" href="/app/_nuxt/5c3a9b2.js" as="script">
  ...
  <script src="/app/_nuxt/92dd6da.js"></script>
  <script src="/app/_nuxt/36dabdf.js"></script>
  <script src="/app/_nuxt/5c3a9b2.js"></script>
  ...

What is actually happening?
dist/index.html
  ...
  <link rel="preload" href="/_nuxt/92dd6da.js" as="script">
  <link rel="preload" href="/_nuxt/36dabdf.js" as="script">
  <link rel="preload" href="/_nuxt/5c3a9b2.js" as="script">
  ...
  <script src="/app/_nuxt/92dd6da.js"></script>
  <script src="/app/_nuxt/36dabdf.js"></script>
  <script src="/app/_nuxt/5c3a9b2.js"></script>
  ...

Some more details:

In v2.15.0 - v2.15.4, this issue does not happen when the router.base configuration is done directly in the nuxt.config.js file
The issue does not happen in v2.14.12

have u solve this problem?

@xixilalaha not yet, I am holding out to Nuxt v2.14.12 for now.

@rarief I am also on Nuxt v2.14.12, but it's not useful for me . I add the base as your way,it's just show me 404!

@xixilalaha could you please elaborate a bit more how did you get the 404 error when using v2.14.12?

Same issue v2.15.6.

I have just experienced this in nuxt v2.15.7

I'm seeing this too. It's causing us real grief around managing our runtime configuration.


Use SharedHelpers#filesystem_access in bundle clean for a friendlier error message for denied permissions

Addresses #4170

👍🏻 perfect other than the one comment

@homu r+

:pushpin: Commit 6657a78 has been approved by segiddins

:zap: Test exempted - status


Storybook dev server port checks can yield false positives

When launching a dev server, we assume that any port opened by the process we launch (or any of its child processes, in the case of wrapper scripts or Windows) is a Storybook dev server and greedily proceed under that assumption. If that turns out not to be the case, we'll either fail to connect or think we've connected (but actually connect to the wrong thing).

If we can look for an affirmative sign that we are using a Storybook dev server, that's the surest sign that we have the right port. We should try to avoid basing this check on anything that might vary between versions or change unexpectedly in the future.
We should still make sure error cases are handled--e.g., server fails to launch

There may also be a bug here where we misidentify a port as being opened when it really hasn't been. If there is such a bug, that may be exacerbating this issue, which is a design problem and should probably be fixed anyway--but fixing the bug would also be helpful.
Ref: https://github.com/joshbolduc/vscode-story-explorer/issues/571#issuecomment-1440301888, #833

This is partially addressed on Mac/Linux by #927, but the design limitation that the first detected port is assumed to be correct remains. (There also may be some Windows-specific bugs that I haven't had a chance to discover.)


Add Docker Pulls

It would be great if we can use https://shields.io/category/downloads and add Docker Pulls.
I have added few samples in the first section. Have a look.
@guptakarishma0304

What I mean is just like GitHub stars, we need to put Docker pulls badges.
On Mon, 20 Jun, 2022, 3:39 pm Ajeet Singh Raina, Docker Captain, ARM
Innovator,, @.***> wrote:

Which one are you referring to?
On Mon, 20 Jun, 2022, 3:37 pm Karishma Gupta, @.***>
wrote:

I tried but got an error as repo not found. Could you please check?
—
Reply to this email directly, view it on GitHub
<
https://github.com/collabnix/docker-community-extensions/issues/14#issuecomment-1160244209
,
or unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AACMRCDNWMSP2KYKVAPN363VQA7GXANCNFSM5ZGRJ4OA
.
You are receiving this because you authored the thread.Message ID:
@.***>

—
Reply to this email directly, view it on GitHub
https://github.com/collabnix/docker-community-extensions/issues/14#issuecomment-1160246812,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AIGG3IRISITLASZR2HOMF5TVQA7PHANCNFSM5ZGRJ4OA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***
com>

oCalm extension added under API