feat: Citations event via event_emitter

Motivation: I would like to create custom citations for my search tool. Example usage:
    async def custom_search_docs(self, query: str, __event_emitter__) -> str:
        await __event_emitter__(
            {"type": "status", "data": {"type": "status", "description": "Retrieving documentation", "done": False}}
        )
        # retrieve use data
        docs = retriever.invoke(query)
        doc = docs[0]
        await __event_emitter__(
            {
                "type": "citation",
                "data": {
                  "document": [doc["page_content"]],
                  "metadata": {"source": doc["metadata"]["url"]},
                  "source": {"name": doc["metadata"]["title"]},
                }
            }
        )
        await __event_emitter__(
            {"type": "status", "data": {"type": "status", "description": "Retrieving documentation", "done": True}}
        )
        # the rest of the tool

This currently doesn't work: I'm guessing messages is not rendered directly?
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:

[x] Target branch: Please verify that the pull request targets the dev branch.
[x] Description: Provide a concise description of the changes made in this pull request.
[x] Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
[ ] Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
[ ] Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
[ ] Testing: Have you written and run sufficient tests for validating the changes?
[x] Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
[x] Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:

BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry
Description

Add the ability to create new citations via __event_emitter__

Added

Add the ability to create new citations via __event_emitter__

Breaking Changes

BREAKING CHANGE: __event_emitter__ now requires type key to specify which kind of event we'd like to emit, with data containing the payload.

Would be good to validate the schema for payload a bit more rigorously: I'm terrible at anything frontend related though, so I don't know what the proper way to do this is. Is there a type definition for citations and status bubbles anywhere?

There's an issue where only the last citation is being rendered in the window at any given time. Looking into it.

Thanks!

Groovy :sunglasses:
https://github.com/open-webui/open-webui/assets/52832301/e229e63c-46ea-4202-9a6a-9b4a446c30d7

Is it working now?!?  Can someone share a code snipped please?  Will this also work inside pipelines?

@PlebeiusGaragicus
"""
title: Web Search using SearXNG and Scrape first N Pages
author: constLiakos with enhancements by justinh-rahb
funding_url: https://github.com/open-webui
version: 0.1.3
license: MIT
"""

import os
import requests
from datetime import datetime
import json
from requests import get
from bs4 import BeautifulSoup
import concurrent.futures
from html.parser import HTMLParser
from urllib.parse import urlparse
import re
import unicodedata
from pydantic import BaseModel, Field
import asyncio
from typing import Callable, Any

class Tools:
    class Valves(BaseModel):
        SEARXNG_ENGINE_API_BASE_URL: str = Field(
            default="https://example.com/search",
            description="The base URL for Search Engine",
        )
        SEARXNG_ENGINE_RESULT_NO: int = Field(
            default=3,
            description="The number of Search Engine Results",
        )
        CITATION_LINKS: bool = Field(
            default=False,
            description="If True, send custom citations with links",
        )

    def __init__(self):
        self.valves = self.Valves()

    async def search_web(
        self,
        query: str,
        __event_emitter__: Callable[[dict], Any] = None,
    ) -> str:
        """
        Search the web and get the content of the relevant pages. Search for unknown knowledge, news, info, public contact info, weather, etc.
        :params query: Web Query used in search engine.
        :return: The content of the pages in json format.
        """

        def get_base_url(url):
            parsed_url = urlparse(url)
            base_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
            return base_url

        def process_result(result):
            title_site = result["title"]
            url_site = result["url"]
            snippet = result.get("snippet", "")  # Get snippet if available

            try:
                response_site = requests.get(url_site, timeout=120)
                response_site.raise_for_status()
                html_content = response_site.text

                soup = BeautifulSoup(html_content, "html.parser")
                content_site = soup.get_text(separator=" ", strip=True)

                content_site = unicodedata.normalize("NFKC", content_site)
                content_site = re.sub(r"\s+", " ", content_site)
                content_site = content_site.strip()

                links = []
                if self.valves.CITATION_LINKS:
                    for a in soup.find_all("a", href=True):
                        links.append(
                            {
                                "title": a.text.strip(),
                                "link": get_base_url(url_site) + a["href"],
                            }
                        )

                return {
                    "title": title_site,
                    "url": url_site,
                    "content": content_site,
                    "snippet": snippet,
                    "links": links,
                }

            except requests.exceptions.RequestException as e:
                return {
                    "title": title_site,
                    "url": url_site,
                    "content": f"Failed to retrieve the page. Error: {str(e)}",
                    "snippet": snippet,
                }

        if __event_emitter__:
            await __event_emitter__(
                {
                    "type": "status",
                    "data": {
                        "status": "in_progress",
                        "description": f"Initiating web search for: {query}",
                        "done": False,
                    },
                }
            )

        number_of_results = self.valves.SEARXNG_ENGINE_RESULT_NO
        search_engine_url = self.valves.SEARXNG_ENGINE_API_BASE_URL
        params = {"q": query, "format": "json", "number_of_results": number_of_results}

        try:
            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "in_progress",
                            "description": "Sending request to search engine",
                            "done": False,
                        },
                    }
                )

            headers = {
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
            }
            resp = requests.get(
                search_engine_url, params=params, headers=headers, timeout=120
            )
            resp.raise_for_status()
            data = resp.json()

            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "in_progress",
                            "description": f"Retrieved {len(data.get('results', []))} search results",
                            "done": False,
                        },
                    }
                )

        except requests.exceptions.RequestException as e:
            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "error",
                            "description": f"Error during search: {str(e)}",
                            "done": True,
                        },
                    }
                )
            return json.dumps({"error": str(e)})

        results_json = []
        if "results" in data:
            results = data["results"][:number_of_results]

            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "in_progress",
                            "description": f"Processing {len(results)} search results",
                            "done": False,
                        },
                    }
                )

            with concurrent.futures.ThreadPoolExecutor() as executor:
                futures = [
                    executor.submit(process_result, result) for result in results
                ]
                results_json = [
                    future.result()
                    for future in concurrent.futures.as_completed(futures)
                ]

            # Add custom citations only if CITATION_LINKS is True
            if self.valves.CITATION_LINKS and __event_emitter__:
                for result in results_json:
                    await __event_emitter__(
                        {
                            "type": "citation",
                            "data": {
                                "document": [result["snippet"] or result["title"]],
                                "metadata": [{"source": result["url"]}],
                                "source": {"name": result["title"]},
                            },
                        }
                    )

        if __event_emitter__:
            await __event_emitter__(
                {
                    "type": "status",
                    "data": {
                        "status": "complete",
                        "description": f"Web search completed. Retrieved content from {len(results_json)} pages",
                        "done": True,
                    },
                }
            )

        return json.dumps(results_json, ensure_ascii=False)

    async def get_website(
        self,
        url: str,
        __event_emitter__: Callable[[dict], Any] = None,
    ) -> str:
        """
        Get the content of the URL provided.
        :params url: The URL of the website
        :return: The content of the page from the URL in json format.
        """

        def get_base_url(url):
            parsed_url = urlparse(url)
            base_url = f"{parsed_url.scheme}://{parsed_url.netloc}"
            return base_url

        def generate_excerpt(content, max_length=200):
            return (
                content[:max_length] + "..." if len(content) > max_length else content
            )

        if __event_emitter__:
            await __event_emitter__(
                {
                    "type": "status",
                    "data": {
                        "status": "in_progress",
                        "description": f"Fetching content from URL: {url}",
                        "done": False,
                    },
                }
            )

        results_json = []

        try:
            headers = {
                "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3"
            }
            response_site = requests.get(url, headers=headers, timeout=120)
            response_site.raise_for_status()
            html_content = response_site.text

            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "in_progress",
                            "description": "Parsing website content",
                            "done": False,
                        },
                    }
                )

            soup = BeautifulSoup(html_content, "html.parser")

            page_title = soup.title.string if soup.title else "No title found"
            page_title = unicodedata.normalize("NFKC", page_title.strip())

            title_site = page_title
            url_site = url

            content_site = soup.get_text(separator=" ", strip=True)
            content_site = unicodedata.normalize("NFKC", content_site)
            content_site = re.sub(r"\s+", " ", content_site)
            content_site = content_site.strip()

            links = []
            if self.valves.CITATION_LINKS:
                for a in soup.find_all("a", href=True):
                    links.append(
                        {
                            "title": a.text.strip(),
                            "link": get_base_url(url_site) + a["href"],
                        }
                    )

            result_site = {
                "title": title_site,
                "url": url_site,
                "content": content_site,
                "excerpt": generate_excerpt(content_site),
                "links": links,
            }

            results_json.append(result_site)

            if self.valves.CITATION_LINKS and __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "citation",
                        "data": {
                            "document": [result_site["excerpt"]],
                            "metadata": {"source": url_site},
                            "source": {"name": title_site},
                        },
                    }
                )

            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "complete",
                            "description": "Website content retrieved and processed successfully",
                            "done": True,
                        },
                    }
                )

        except requests.exceptions.RequestException as e:
            results_json.append(
                {
                    "url": url,
                    "content": f"Failed to retrieve the page. Error: {str(e)}",
                }
            )

            if __event_emitter__:
                await __event_emitter__(
                    {
                        "type": "status",
                        "data": {
                            "status": "error",
                            "description": f"Error fetching website content: {str(e)}",
                            "done": True,
                        },
                    }
                )

        return json.dumps(results_json, ensure_ascii=False)

THANKS.  Bless you sir.
Does this also work for pipelines?  That's honestly where I'd be using it.
I need to emit the state of my graph computation.  My pipeline will call a LangServe endpoint and being able to show the progress in the UI would be essential.

Does this also work for pipelines? That's honestly where I'd be using it.

Unfortunately not. As of now it works with tools and filter functions (but not regular functions/manifolds). I was planning to make it work for regular functions but 0.3.8 got released first, and there are a lot of things I would have to refactor to do that.


A call for quality articles, examples, and resources

We have some in Ecosystem, but too little.
We have some in Awesome Redux, but too many.
What are your favorite Redux articles, examples, and resources? Something that shed a light on a practical issue? Helped Redux “click” for you? Provided you the most value? Why are these resources your favorite ones? What's special about them?
Please share your findings and/or promote your work. :wink:
Thank you for your input!

The code cartoons, of course :wink:

https://code-cartoons.com/a-cartoon-intro-to-redux-3afb775501a6
https://code-cartoons.com/a-cartoon-guide-to-flux-6157355ab207

Helped Redux “click” for you? Provided you the most value?

The docs :stuck_out_tongue_winking_eye:

Excluding the official docs. :scroll:

I found the conventions suggested in Ducks: Redux Reducer Bundles really useful the first time I was working on a project with many reducers which managed distinct sections of state. It helped tame what was about to become an explosion of modules in my project.

When I first came across Redux I went straight to the documentation and the example code. I had completely skipped over the absolutely amazing Gist in the README. Whenever I tell people to take a look at Redux I point them to two places. First, the gist in the README, second the source code. At ~250 lines it's dead simple and paired with the README gist I don't know if there is much more anyone needs to understand how Redux works. After that your first talk is what got me really excited about how powerful such a simple library really is.

Very nice high level overview intro:
http://www.youhavetolearncomputers.com/blog/2015/9/15/a-conceptual-overview-of-redux-or-how-i-fell-in-love-with-a-javascript-state-container

Full-Stack Redux Tutorial http://teropa.info/blog/2015/09/10/full-stack-redux-tutorial.html

https://github.com/erikras/react-redux-universal-hot-example has been great for a more advanced boilerplate starting point. It moves very quickly, though, and we haven't implemented any real versioning on it.

+1 on the teropa tutorial that @ArmendGashi mentioned.
Also loved this one for understanding the fundamentals: https://github.com/happypoulp/redux-tutorial -- I wrote the "How I Fell in Love with a JS State Container" article, and this really cemented the concepts for me.
I found these tutorials especially useful because the authors explain each step in excruciating detail, and place each step in context of the final application. When I'm learning something new, I feel like every line of code should be beaded with sweat. This is my preference.

Themes and styles conventions with redux
https://github.com/SamLebarbare/redux-theme

Sometimes it's essential to load reducers on demand.
This helped me a lot. Thanks to @gaearon .
http://stackoverflow.com/questions/32968016/how-to-dynamically-load-reducers-for-code-splitting-in-a-redux-application
Would be awesome to add an example how to load and unload some reducers.

There are a couple of boilerplates with redux-actions and redux-promise here: http://helmetrex.com

I think some culling should be done to Awesome Redux before it becomes too big to be useful (like many Awesome lists). The Examples section is a mess and probably full of outdated, unmaintained, or even poorly written ones. I would argue you only need about 15 examples at most (even that's a stretch). The tutorial list should be looked over too, in case there's outdated ones. Also, the formatting could use some work.
I am willing to help with the formatting, but I don't have enough Redux experience to make decisions on what to keep or delete.

@sotojuan good idea! please create an issue on the awesome redux tracker for this and link to it here - I think the repo maintainer should know what to remove and what to keep :smile:

@sotojuan

I think the Ecosystem list doesn't have "too little" links. It has more than enough, and adding additional ones should require more than someone linking their project (i.e. there should be some sort of approval).

I vet all links there. :wink: I'm only proposing people to share new stuff so I can review it in case I haven't seen it before!

I think some culling should be done to Awesome Redux before it becomes too big to be useful (like many Awesome lists). The Examples section is a mess and probably full of outdated, unmaintained, or even poorly written ones.

I agree!
@xgrommx What do you think?
It might be a good idea to take a week to over the repos there, select the ones that are up-to-date and show different usage aspects, etc, and have higher quality.

I like this article about server side rendering and redux: https://medium.com/@bananaoomarang/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4

If you are open to the idea of including boilerplate starter projects for react-redux apps then apart from https://github.com/erikras/react-redux-universal-hot-example, I highly recommend https://github.com/davezuko/react-redux-starter-kit which is much more focused and straightforward.

To be honest nothing I've read has come close to the official docs and examples.

Things that helped redux "click" for me:

Actions are "fire and forget". If you need to do track the "request", initiated by action, then instead of waiting for the action to resolve you should design a "state diagram" of your "request" and implement it in the reducer/actions.
Instead of writing a reducer and actions for every button and such you can apply the "class/instance" pattern, and carry the "instance id" with the action.
Instead of writing a reducer and actions for every "view" you can apply the "composition" pattern and compose small things into bigger ones.

Hey @gaearon,
For React testing, I really really like Shallow Rendering. Its nice to not need a DOM - the tests run so fast! - and it forces me to keep my tests modular. There is an egghead.io course of video lessons on it:
https://egghead.io/series/react-testing-cookbook
The course walks through setting up a React testing environment, using the Shallow Render to test component output, and breaking utility modules out into their files to test them separately. It also includes a few lessons on testing Flux/Redux. Some of the lessons are free, some require a subscription. Hope this is helpful :)

@gaearon I have just published an example explaining why composition matters and how it can help us to better encapsulate our components. http://blog.javascripting.com/2016/02/02/encapsulation-in-redux/
My experience is that inexperienced people often tend to ignore the concept and sometimes simply abuse the global app state, which leads to an unnecessarily complex application logic.
You might consider adding this to Redux docs as a reference to composition.

Refs https://github.com/rackt/react-redux/issues/278 re: encapsulation.

This is really great:
http://www.toptal.com/react/react-redux-and-immutablejs

Great explanation of middleware
http://blog.krawaller.se/posts/exploring-redux-middleware/

This is a good series:
https://shellmonger.com/2016/02/16/an-introduction-to-react-redux-part-1/

I took Cory House course on React-Redux and es6, made redux click for me.

We've got a (few!) awesome lists going. I think this is covered now! But please keep the good stuff coming!


Add support for aarch64-unknown-linux-gnu

fixed in https://github.com/EmbarkStudios/physx-rs/pull/154


Rewards are inaccurate

It appears the calculated blood bonds and XP are correct, but the total hunt dollars collected per match is often lower than should be.

Total hunt dollars include level up rewards. Values are correct.


735 | Asteroid Collision | C++

Asteroid Collision
What will change -
Add new leetcode problem in the C++ folder with optimized C++ solution
Type of Issue -
Please add/delete options that are not relevant.

[x] Adding New Code

Programming Language
Please add/delete options that are not relevant.

[x] C++

Self Check

Ask for issue assignment and wait to get assigned to it before making Pull Request.
Add your file in the proper folder
Clean Code and Documentation for better readability
Add Title and Description of the program in the file

:star2: Star it :fork_and_knife:Fork it :handshake: Contribute to it!
Discord server ✉ - https://discord.gg/CXksGdn
Happy Coding,

please assign to me

Please assign this issue to me.

Can I solve this issue if its still open and unassigned?

I have solved this problem. Can I make a pull request?


July 2022 update

Drivers and new text provided by Bob B from docs.
Verify buttons work in index.md after merge.
windows/NodeJS-2<IP_ADDRESS>.0-win_x64.exe is an empty dummy file.

@semanej, please review.


[cf-forms] Use datalist element with select element fallback

From @cfarm in https://github.com/cfpb/cf-forms/issues/34

We can implement this technique to make more useful, usable inputs for things like States.
The datalist element is an HTML5 form element that auto-suggests results from the list based on the user's typed input. So if you start typing "P" in a State datalist you'll get Pennsylvania and other suggestions in the field.
For browsers that don't support this element, we can include a <select> element inside it as a fallback, which is the same as it works now. More on this technique: https://adactio.com/journal/4272

Support isn't great http://caniuse.com/datalist/embed/


Is it possible to just get the title of the window itself?

Is it possible to just get the title of the window itself? For example, only firefox, only alacritty, only neovim. At the moment it captures the full title of the window

I may be possible. Have a look at the output of hyprctl clients -j, specifically at initialTitle and class. Do they look more like what you're after? Currently the app is pulling from title, but wouldn't be too difficult to include those extra fields in the advanced version of the app.

Yes, I'll read the code one of these days haha, I'm making a Rice in eww
and I think it would look better just showing the title of the app.
Em seg., 29 de jan. de 2024 22:02, FieldofClay @.***>
escreveu:

I may be possible. Have a look at the output of hyprctl clients -j,
specifically at initialTitle and class. Do they look more like what you're
after? Currently the app is pulling from title, but wouldn't be too
difficult to include those extra fields in the advanced version of the app.
—
Reply to this email directly, view it on GitHub
https://github.com/FieldofClay/hyprland-activewindow/issues/6#issuecomment-1915863751,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AZKAMUBCUL6AQ66BOQZ3BGDYRBBCXAVCNFSM6AAAAABCMINXHWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVHA3DGNZVGE
.
You are receiving this because you authored the thread.Message ID:
@.***>

The initial title of a window is now output in advanced mode, alongside the current title.


[release request] OneCollector 1.10.0-rc.1

Component
OpenTelemetry.Exporter.OneCollector
Version
1.10.0-rc.1
Additional context
No response

@ @CodeBlanchOrg/dotnet-approvers @CodeBlanchOrg/dotnet-maintainers
Post a comment with "/PrepareRelease" in the body if you would like me to execute the prepare release script for the component and version listed in the description.

/PrepareRelease

I'm sorry @CodeBlanchTest2 but you don't have permission to execute the prepare release script. Only maintainers, approvers, and/or owners of the component may use the "/PrepareRelease" command.


build_orchestrator: Add metadata fragments from koji_upload

When the new plugin, koji_upload, is enabled, it will pass metadata
from the worker to the orchestrator through an osbs configmap object.
The pointer to this configmap object will be passed through an annotations
object.  Currently, orchestrator plugins can not access this metadata
info because it is not saved.
Save the info inside get_annotations() if available.  This will allow
future plugins like post_fetch_worker_metadata to grab and utilize
this data.

Verified this is already in the release notes.


Improve Chronograf docs re: security setup

There is some confusion re: when/why the Chronograf Admin tab appears (or not).
I set up Chronograf and did the install but I’m not sure why according to the documentation I should see Chronograf Admin but I do not. I only see InfluxDB Admin.
URL for relevant page?
https://docs.influxdata.com/chronograf/v1.7/administration/managing-security/
https://docs.influxdata.com/chronograf/v1.7/administration/managing-chronograf-users/
https://docs.influxdata.com/chronograf/v1.7/administration/managing-organizations/
What products and version are you using?
Chronograf 1.4 or higher
Where did you look before opening the issue?
Current doc set.
See attached image.

It sounds like the documentation isn't clear about when this particular tab appears and that it ONLY appears once you've configured the authentication/authorization setup for Chronograf itself.  We need to figure out how to highlight this within the documentation for Chronograf.

Thanks, @timhallinflux - clarified docs to address this issue.


Deprecated terminal settings should have a deprecation message

While testing https://github.com/microsoft/vscode/issues/120366, I found the profile settings confusing in relation to the old shell and shellArgs settings. I know about the shell and shellArgs settings, so of course I look at them first for guidance. Since they are now deprecated, the schema should show a message to that effect to help guide me to use the new settings correctly.

it's not clear how we should replace shellArgs with defaultProfile - can't see anything in the docs about defaultProfile.
how should I change my current setting?
 "terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"],

For powershell you would use either:
  "terminal.integrated.profiles.windows": {
    "PowerShell": {
      "source": "PowerShell",
      "icon": "terminal-powershell",
      "args": ["-ExecutionPolicy", "Bypass"]
    }
  }

Then set it as your default via the new dropdown next to the + button or with this setting:
"terminal.integrated.defaultProfile.windows": "PowerShell"

Created https://github.com/microsoft/vscode-docs/issues/4526 to fix up the docs.
Some more info in the release notes https://code.visualstudio.com/updates/v1_56#_terminal


start_col must be less than end_col

When you do a regular visual selection that starts at column x and goes backwards, an error occurs
My naive fix that seems to work with little testing is to add this into the Util.get_bounds function before it returns.
    if vline_start > vline_end then
        local temp = vline_start
        vline_start = vline_end
        vline_end = temp
    end
    if vcol_start > vcol_end then
        local temp = vcol_start
        vcol_start = vcol_end
        vcol_end = temp
    end

changing the vline may not be necessary, and this probably breaks other things but it's a start.

Thanks for pointing this out! It should be fixed now. If this issue reappears feel free to comment here and I'll reopen this issue.


Channel.get_messages() crashes half the time

thread 'serenity client' panicked at 'called `Result::unwrap()` on an `Err` value: Json(ErrorImpl { code: Message("unknown field `animated`, expected `id` or `name`"), line: 1, column: 4439 })', /checkout/src/libcore/result.rs:916:4
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at /checkout/src/libstd/sys_common/backtrace.rs:68
             at /checkout/src/libstd/sys_common/backtrace.rs:57
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:538
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::result::unwrap_failed
             at /checkout/src/libcore/macros.rs:23
  10: <core::result::Result<T, E>>::unwrap
             at /checkout/src/libcore/result.rs:782
  11: <stestcase::Handler as serenity::client::event_handler::EventHandler>::on_ready
             at src/main.rs:21
  12: serenity::client::dispatch::handle_event::{{closure}}
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/serenity-0.4.5/src/client/dispatch.rs:402
  13: <core::result::Result<T, E>>::map
             at /checkout/src/libcore/result.rs:468
  14: serenity::client::dispatch::handle_event
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/serenity-0.4.5/src/client/dispatch.rs:398
  15: serenity::client::dispatch::dispatch
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/serenity-0.4.5/src/client/dispatch.rs:63
  16: <serenity::client::bridge::gateway::shard_runner::ShardRunner<H>>::run::{{closure}}
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/serenity-0.4.5/src/client/bridge/gateway/shard_runner.rs:123
  17: <F as threadpool::FnBox>::call_box
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.7.1/src/lib.rs:95
  18: threadpool::spawn_in_pool::{{closure}}
             at /home/anna/.cargo/registry/src/github.com-1ecc6299db9ec823/threadpool-1.7.1/src/lib.rs:767

Half the time I run get_messages(), it crashes. The other half, it works fine. Repeatedly running it gets a mix of crashes and successes. There's no pattern as far as I can figure out. Here's an adequate test case for experiencing this behaviour:
extern crate serenity;

use serenity::model::{Ready, Message};
use serenity::prelude::*;
use serenity::client::Context;

fn main() {
    let token = std::env::var("DISCORD_TOKEN").unwrap();
    let mut client = Client::new(&token, Handler);
    client.start();
}

struct Handler;

impl EventHandler for Handler {
    fn on_ready(&self, ctx: Context, r: Ready) {
        let mut server = r.guilds[0].id();
        let channel = server.channels().unwrap().values().next().unwrap().clone();

        let recent_messages = channel.messages(|m| m).unwrap(); // crashes here
    }
}

Thanks, I'll look into this.

Could you try out branch branch-v0.4.6 and see if 5286949f424e824784344ebb7b7af4e52fb819c3 fixes it?
Add the following to your Cargo.toml to use it:
[dependencies.serenity]
branch = "branch-v0.4.6"
git = "https://github.com/zeyla/serenity"

Published a fix as v0.4.6 on crates.io, thanks for the report.


support multiple unlock conditions per output

However, the type of each unlock condition per output has to be unique. This too avoid to have too many conditions per output. If however we think it might be useful to allow multiple unlock conditions of the same type, we'll need a different approach.
Either way, this is the proposed in-memory structure layout of a new Transaction version (0x01), which would allow multiple unlock conditions per output:
TransactionV1 struct { // 0x01, as a replacement for the current and original transaction version 0x00
    CoinInputs        []struct{
        ParentID  CoinOutputID   `json:"parentid"`
        Unlockers []InputLockProxy `json:"unlockers"`
    }
    CoinOutputs       []struct{
        Value        Currency     `json:"value"`
        UnlockHashes []UnlockHash `json:"unlockhashes"`
    }
    BlockStakeInputs  []struct{
        ParentID  BlockstakeOutputID   `json:"parentid"`
        Unlockers []InputLockProxy     `json:"unlockers"`
    }
    BlockStakeOutputs []struct{
        Value        Currency     `json:"value"`
        UnlockHashes []UnlockHash `json:"unlockhashes"`
    }
    MinerFees         []Currency
    ArbitraryData     []byte

    _VersionNumber TransactionVersion // 0x01
}

This would allow wallets to also automatically match and sort outputs that are destined for it, even if the unlock conditions are more complex.

Proposal has been superceded by a new proposed transaction version, which can be found as issue #259.


Rewardvideo ads 0$ earning

i use this Rewardvideo in my app i get 74862 impressions and 0 click and  0$ earning i don't know what is wrong , the banner and interstitial it's work perfect i get click and earning is normal
statistic for Rewardvideo :
[](url

)
My code :
document.addEventListener('deviceready', function() {
admob.rewardvideo.config({
    id        :"admobID",
    isTesting : false,
    autoShow  : false,
  })
admob.rewardvideo.prepare();
document.addEventListener('admob.rewardvideo.events.REWARD',function(event) {
  console.log(event);
})
document.addEventListener('admob.rewardvideo.events.LOAD_FAIL',function(event) {
  console.log(event);
})
document.addEventListener('admob.rewardvideo.events.LOAD',function(event) {
  console.log(event)
})
  document.addEventListener('admob.rewardvideo.events.CLOSE',function(event) {
  console.log(event)
  admob.rewardvideo.prepare();
  });
 });

so what is wrong ?
Thank you.

Same problem here. Idi you find any solution ?

no nothing :/

I have no hope that this will be corrected. The plugin is leaving, I have no knowledge to fix the problem. unfortunately.

mine is working...code as same as you ... low CPM but some


Drop support for mauricio/postgreasync

The project https://github.com/mauricio/postgresql-async has been discontinued for about a month. Since it has several bugs (many performance ones), it may be the time to migrate to a fork or to use another non-blocking database library.
I see you guys were already working on the NDBC driver (https://github.com/traneio/ndbc) in this PR #855. Any news on this PR?

@gabfssilva thanks for opening this issue. I didn't notice that the project is discontinued now. Ndbc should be a good replacement. The postgres driver is ready and the mysql driver is almost complete.

Closed once ndbc modules have been dropped


How can I draw the lines on holes in polygons?

How can I draw the lines on holes in polygons? In the example on Pixi Playground I have created a polygon square and then defined two holes.  If I call the function .addHole() it will correctly add a hole in the square shape, but the lines are not being drawn on the hole (big triangle).
Just to be clear, I would like to be able to add one or more holes to a shape and have those holes be drawn with the same linestyle as the rest of the shape.

pixi.js version: 4.8.7
Browser & Version: Chrome v. 73.0.3683.86
OS & Version: Windows 10
Running Example: https://www.pixiplayground.com/#/edit/Ak~6AKnGVYdJTkmB1Y~W~

Hey! It was fixed in pixi-v5 , https://github.com/pixijs/pixi.js/pull/5516 , dont mind the name of PR, it has the demo.
I dont know whether its possible to port it back to v4, maybe its an easy port, I can look later. Depending on whether you have big old project or new demo you can try v5.

Your easiest solution in v4 is to draw another triangle where the hole is that has the line style and transparent fill.
https://www.pixiplayground.com/#/edit/kn8TI2dhHZLyTAR~MfIeM

I don't think this is worth back-porting lines + holes. The graphics stuff is dramatically different in v5 and the hole API is half-backed in v4 anyways (doesn't work with shapes, etc). There's also a workaround above.


add bivariate choropleth wizard

http://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/
to show more than one variable
cc @ohasselblad @saleiva

It would be a nice addiction to pecan

info on divergent bivariate maps (with an interesting tool combining quantification bin sizes, a graph, and color scheme):
http://indiemapper.com/app/learnmore.php?l=bivariate_choropleth

There has been no activity on this issue for more several months. We are closing it. If you think this still needs to be addressed please open a new issue.


No intuitive and easy way to close a position (as available in the dydx UI)

I am having trouble closing an existing position in the dydx-v3-python package, whereas this can be easily accomplished using the UI.
Otherwise one has to manually calculate prices for closing the position, which can be tedious.

I'm searching for a solution too. Something like market sell, to sell imminently.
To sell with limit orders does not work so often...

Devs, can you weigh in here? Except a read-only historical list there seems to be no way to open / close a position from the API as you can from the UI. Without the ability to open & especially close positions we cannot integrate our platform into DYDX.

@Bennch , @gabrielfior , this is possible.
You need to fetch your open positions via a call to private_client.private.get_account()
The open positions will have a market and a size (amount).
Then simply for that market / size create a sell order, for example,
    r = private_client.private.create_order(
        position_id=position_id,
        market=MARKET_ETH_USD,
        side=ORDER_SIDE_SELL,
        order_type=ORDER_TYPE_MARKET,
        post_only=False,
        size='0.01',
        price='2020.0',
        limit_fee='0.015',
        expiration_epoch_seconds=1652619576,
        time_in_force=TIME_IN_FORCE_FOK
        )

That is what i was trying all the time. But if the orderbook is low, the order will not be filled. I real MARKET order shout not need a price variable.

That is what i was trying all the time. But if the orderbook is low, the order will not be filled. I real MARKET order shout not need a price variable.

Yeah, I found that confusing as well. I traced the UI and I noticed that the price is +100 above or below the index price. And checking the result the order was executed for the actual index price. So I'm guessing the backend is doing BEST(price, index).

An other possible way to do it as sugested by @hbeijeman could be tracking your current open positions with
all_positions = client.private.get_positions(   market=MARKET_ETH_USD,   status=POSITION_STATUS_OPEN, )
filter by any desired conditions (such as entryPrice) then just getting the side (either LONG or SHORT) and creating an opposite order.

... Would be fantastic, if this were implemented in a simply way into the  dydx-v3 python wrapper, any plans of doing that ?


Fix race with subsegments

Solves a race condition when using subsegments in goroutines.
WARNING: DATA RACE
Read at 0x00c420256798 by goroutine 26:
vendor/github.com/aws/aws-xray-sdk-go/xray.BeginSubsegment()
vendor/github.com/aws/aws-xray-sdk-go/xray/segment.go:184 +0x347
lib.worker()
lib/health.go:74 +0x296
lib.(*Controller).GetHealthcheckHandler.func2()
lib/health.go:140 +0x80
Previous write at 0x00c420256798 by goroutine 23:
vendor/github.com/aws/aws-xray-sdk-go/xray.BeginSubsegment()
vendor/github.com/aws/aws-xray-sdk-go/xray/segment.go:184 +0x369

Running make test with -race on master:
--- FAIL: TestErrorCapture (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x15cd21b]

goroutine 51 [running]:
testing.tRunner.func1(0xc420286000)
        /usr/local/opt/go/libexec/src/testing/testing.go:742 +0x567
panic(0x166a660, 0x1a0c480)
        /usr/local/opt/go/libexec/src/runtime/panic.go:505 +0x24a
github.com/aws/aws-xray-sdk-go/xray.TestErrorCapture(0xc420286000)
        /Users/gcharmes/go/src/github.com/aws/aws-xray-sdk-go/xray/capture_test.go:76 +0x42b
testing.tRunner(0xc420286000, 0x1709990)
        /usr/local/opt/go/libexec/src/testing/testing.go:777 +0x16e
created by testing.(*T).Run
        /usr/local/opt/go/libexec/src/testing/testing.go:824 +0x565
FAIL    github.com/aws/aws-xray-sdk-go/xray     0.063s
make: *** [test] Error 1

Update: as the build was failing for the PR, I added a .travis.yml, cleaned up the Makefile and fixed the lint/fmt/vet errors.
Update2: There is a race in the tests, not detected by the race tool. After fixing the test to avoid panic, I got (after ~10 runs):
$> while go test -failfast -count=1 -cover -race github.com/creack/aws-xray-sdk-go/xray; do; done
[...]
--- FAIL: TestErrorCapture (0.00s)
        Error Trace:    capture_test.go:84
        Error:          Expected value not to be nil.
        Messages:       Missing cause from error subsegment.

--- FAIL: TestPanicCapture (0.00s)
        Error Trace:    capture_test.go:114
        Error:          Not equal: "MyPanic" (expected)
                                != "MyError" (actual)

        Error Trace:    capture_test.go:115
        Error:          Not equal: "panic" (expected)
                                != "error" (actual)

        Error Trace:    capture_test.go:116
        Error:          Not equal: "TestPanicCapture.func1.2" (expected)
                                != "TestErrorCapture.func1" (actual)

        Error Trace:    capture_test.go:118
        Error:          Not equal: "TestPanicCapture.func1" (expected)
                                != "TestErrorCapture" (actual)

        Error Trace:    capture_test.go:119
        Error:          Not equal: "TestPanicCapture" (expected)
                                != "tRunner" (actual)

FAIL

It was due to the TestDaemon leaking from one test to another. I did a minor refactor so each test has it's own daemon.

@creack, thank you so much for sending out this PR. I am sorry I approved your PR by mistake. I think we still have to spend some time working on this PR before merging to our branch. I already submit a review and free feel to add some comments or changes into it.

I think all your coment have been addressed. Let me know if I missed something.


[FIX] Removing of Random Suffix and Reforge

Now keeps randomSuffix when removing a reforge of a randomSuffix item
Now removes reforge and reforge tab when removing randomSuffix
Added correct button state for Remove Random Suffix tab

Included in https://github.com/wowsims/cata/pull/648


Proper way to destroy modbus client object

My modbus TCP server device (actually it's ABB AC500 series PLC) closes connection after data was send, so i need to make new socket connection to PLC every time i want to read/write data from/to PLC, e.g. to keep polling mbus registers (or coils, whatever).
This question seems to be close to https://github.com/dresende/node-modbus-tcp/issues/23 but in my case 'simply piping new socket to old modbus stream consumer' leads to memory leaking (both RSS and heap keep growing). I've tried to unpipe both sides (reader and writer), destroy streams - same result.
My current workaround is to wrap instantiated socket and modbus clients into object and then after they are finished their job, just null object entries and delete them to make sure that there are no more streams hanging around:
const netModule = {
  mbClient: new modbus.Client(),
  socket: new net.Socket({
    allowHalfOpen: false,
    readable: true,
    writable: true
  })
}

const streams = {
  writer: netModule.mbClient.writer(),
  reader: netModule.mbClient.reader()
}

// burn em after using
const unrefObjKeys = obj =>
  Object.keys(obj).forEach(key => {
    obj[key] = null
    delete obj[key]
  })

unrefObjKeys(netModule)
unrefObjKeys(streams)

This workaround fixes memory leaking, but looking pretty dirty, right?

Hi, I no longer maintain this repo. Try the new version which handles all kinds of modbus.
https://github.com/node-modbus/stream
Also, it has a proper method for closing streams.


DCOS-20690: Nodes overview page filter by service is wrong

Change the label to be more accurate
Closes https://jira.mesosphere.com/browse/DCOS-20690
Testing
Go to Nodes tab and verify that the dropdown has the new label.
Trade-offs
https://github.com/dcos/dcos-ui/compare/gt/fix/DCOS-20690-nodes-filter-by-service?expand=1#diff-758096c192079a23867a134b9aa82082L4296 needs to be translated, not sure what the procedure is.
https://github.com/dcos/dcos-ui/compare/gt/fix/DCOS-20690-nodes-filter-by-service?expand=1#diff-fcd9383c392695ef2467eb64d8a78981R54 isn't marked for translation, but I think it should be.
Dependencies
None.
Screenshots
Before

After

Is there a reason we can't mark this string for translation? https://github.com/dcos/dcos-ui/compare/gt/fix/DCOS-20690-nodes-filter-by-service?expand=1#diff-fcd9383c392695ef2467eb64d8a78981R54

@mperrotti , good catch, we probably forgot it. Will add it.

Updated.

Updated message catalog format, please take another look when you have time.

:tada: This PR is included in version 2.40.12 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


[Feature request] Transparency support in image of account's logo

Now, transparent background just replaced to black color

If you uses a PNG image with transparent background, FreeOTP+ will respect that. The JPG won't have transparent background.

Please, take a look.
icons.zip

@helloworld1 This isn't correct. Transparent PNG images show black instead of a transparent background, as the original poster described.

Yes, I am able to reproduce the issue on the Android 7.1 emulator. Not sure why some PNGs are displaying black background.

I have the same issue with the black background on transparent images. Is there any chance to fix this?

Yes, for sure. Will need to investigate further. There could be a simple fix.

Could be fixed with https://github.com/helloworld1/FreeOTPPlus/pull/70 :)


Component value doesn't update

Hi,
I have 3 TextField components: price, taxRate and totalPrice.
I want to modify totalPrice when the price was change by applying the formula totalPrice = price * (1+taxRate/100).
I tried to change the value of totalPrice inside the OnChange function by changing  this.state.selectedInvoice.totalPrice but the totalPrice Text field don't show the new value.
I figure out that the render function is not called after on change and i force calling with this.forceUpdate(). Nothing happen.
I don't have any idea of what I can do to change the value of the totalPrice.
Thank you in advice
Bogdan
"react": "^15.6.1",
"material-ui": "^0.18.7",

Please submit support requests and questions to StackOverflow using the tag material-ui. StackOverflow is better suited for this kind of support. The issue tracker is for bug reports and feature discussions. See also our CONTRIBUTING guidelines.


feat: add upstash vector store

This PR adds Upstash Vector as a storage.

this should be a minor changeset b/c its adding new feature

Hi @himself65,
we would like to close this PR and continue with another PR because Oguzhan is no longer with our team.
I can fork his fork and continue on another PR


Update azure-stack-update-1803.md

Adding Hotfix and Support policy information.

Closing per Brent Dunsire's comments above.


Fix RST typo in form validation docs

The lack of a space after the closing double-backticks was upsetting the RST, so the sentence was appearing as
such as “if field A``is supplied, field ``B must
which this fixes.
At time of writing, this can be seen in the online docs at https://docs.djangoproject.com/en/1.9/ref/forms/validation/

merged in 1aa8bf9b43bbc214770389b9b8d084552040fa44, thanks.


Inconsistency in boolean validation of [Freed Object]

Godot version
v4.0.alpha5.official [d7d528c15]
System information
Ubuntu
Issue description
I'm aware we ought to use is_instance_valid() to validate an Object.
However in Godot 4 things may be a little different since comparison with null is now possible.
While [Freed Object] == null and not [Freed Object] was false in Godot 3, it is now true in 4.
However, [Freed Object] still validates to true in an if, while null validates to false.
This now results in very strange behavior:
var lele = Node.new()
lele.free()

if lele and not lele:
    print("this prints")

or:
if lele == null:
    print(lele, " is null")

if lele:
    print(lele, " is true")

if not null:
    print("null is false")

[Freed Object] is null
[Freed Object] is true
null is false

Many new users try comparison with null first before learning about is_instance_valid() (why this doesn't work in Godot 3 is a very common question). Since this yields the expected result now, they'll likely stick to it and never learn about is_instance_valid(). Treating [Freed Object] like null will however end up in users assuming if [Freed Object]: will validate to false, which it does not.
So here's the two solutions I can see (either or):

Behavior of Godot 3 should be restored

Meaning [Freed Object] == null and not [Freed Object] should both be false again

if [Freed Object]: should validate to false as well

Which would reduce complexity as we could actually do away with is_instance_valid()

Steps to reproduce
Run example code in a _ready function.
Minimal reproduction project
No response

cc @vnen

I also wanted to report this. I hope this will be helpful.

print
3.4.2 Freed Object
3.4.2 null
4.0a5 Freed Object
4.0a5 null

value
[Deleted Object]
Null
[Freed Object]
null

not value
False
True
true
true

"+" if value else "-"
+
-
+
-

is_instance_valid(value)
False
False
false
false

value == null
False
True
true
true

typeof(value) == TYPE_NIL
False
True
false
true

typeof(value) == TYPE_OBJECT
True
False
true
false

value is Object
True
False
true
false

value is Node
Error
False
Error
false

Details
v3.4.2.stable.official [45eaa2daf]
tool
extends EditorScript

func test(value):
    print("-----")
    print("value                         ", value)
    print("not value                     ", not value)
    print('"+" if value else "-"         ', "+" if value else "-")
    print("is_instance_valid(value)      ", is_instance_valid(value))
    print("value == null                 ", value == null)
    print("typeof(value) == TYPE_NIL     ", typeof(value) == TYPE_NIL)
    print("typeof(value) == TYPE_OBJECT  ", typeof(value) == TYPE_OBJECT)
    print("value is Object               ", value is Object)
    print("value is Node                 ", value is Node)

func _run():
    var object = ClassDB.instance("Object")
    object.free()
    test(object)

    var node = Node.new()
    node.free()
    test(node)

    test(null)

-----
value                         [Deleted Object]
not value                     False
"+" if value else "-"         +
is_instance_valid(value)      False
value == null                 False
typeof(value) == TYPE_NIL     False
typeof(value) == TYPE_OBJECT  True
value is Object               True
 res://_dev/_run.gd:14 - Left operand of 'is' was already freed.
-----
value                         [Deleted Object]
not value                     False
"+" if value else "-"         +
is_instance_valid(value)      False
value == null                 False
typeof(value) == TYPE_NIL     False
typeof(value) == TYPE_OBJECT  True
value is Object               True
 res://_dev/_run.gd:14 - Left operand of 'is' was already freed.
-----
value                         Null
not value                     True
"+" if value else "-"         -
is_instance_valid(value)      False
value == null                 True
typeof(value) == TYPE_NIL     True
typeof(value) == TYPE_OBJECT  False
value is Object               False
value is Node                 False

v4.0.alpha5.official [d7d528c15]
@tool
extends EditorScript

func test(value):
    print("-----")
    print("value                         ", value)
    print("not value                     ", not value)
    print('"+" if value else "-"         ', "+" if value else "-")
    print("is_instance_valid(value)      ", is_instance_valid(value))
    print("value == null                 ", value == null)
    print("typeof(value) == TYPE_NIL     ", typeof(value) == TYPE_NIL)
    print("typeof(value) == TYPE_OBJECT  ", typeof(value) == TYPE_OBJECT)
    print("value is Object               ", value is Object)
    print("value is Node                 ", value is Node)

func _run():
    var object = ClassDB.instantiate("Object")
    object.free()
    test(object)

    var node = Node.new()
    node.free()
    test(node)

    test(null)

-----
value                         [Freed Object]
not value                     true
"+" if value else "-"         +
is_instance_valid(value)      false
value == null                 true
typeof(value) == TYPE_NIL     false
typeof(value) == TYPE_OBJECT  true
value is Object               true
  res://_dev/_run.gd:14 - Left operand of 'is' is a previously freed instance.
-----
value                         [Freed Object]
not value                     true
"+" if value else "-"         +
is_instance_valid(value)      false
value == null                 true
typeof(value) == TYPE_NIL     false
typeof(value) == TYPE_OBJECT  true
value is Object               true
  res://_dev/_run.gd:14 - Left operand of 'is' is a previously freed instance.
-----
value                         null
not value                     true
"+" if value else "-"         -
is_instance_valid(value)      false
value == null                 true
typeof(value) == TYPE_NIL     true
typeof(value) == TYPE_OBJECT  false
value is Object               false
value is Node                 false

I don't know how the is operator should behave in this case. Should inheritance be checked for freed objects?

print
Freed Object
Freed Node
null

value is Object
true
true
false

value is Node
false
true
false

It's probably not possible, but it's strange that is works for Object but doesn't work for child classes. In my understanding, is should be a safe operator.

if [Freed Object]: should validate to false as well

I don't think this is the right solution, if [Freed Object]: and if not [Freed Object]: should not both be false (since not [Freed Object] should be false).

I don't think this is the right solution, if [Freed Object]: and if not [Freed Object]: should not both be false (since not [Freed Object] should be false).

not [Freed Object] would be true as is currently the case, just like not null is true.
the two solutions I've listed are either or.

The error is still reproduced in 4.0 beta 1.

Related?
# 3.x
print(1 if ""  else 2) # 2
print(1 if !"" else 2) # 1

# 4.0 beta 3
print(1 if ""  else 2) # 2
print(1 if !"" else 2) # 2

The main question is whether freed_object == null returns true or false. The rest should follow from this via transitivity (that is if freed_object == null and null == false then freed_object == false).
 This avoids an extra check. It is also more beginner friendly since everyone hits the "freed object" problem and gets confused, this wouldn't happen anymore.
OTOH it might be a bug in the game logic if you are dealing with freed objects, so you may want to catch that and fix the source of the bug. If this is true then this check would be pretty much impossible. In fact, is_instance_valid() would become pointless.

Actually, it was pointed out to me that is_same(freed_object, null) is always false, so that would be one way to check for freed objects, even if freed_object == null is true.

null != false if I remember correctly. Transitivity is not always satisfied (at least for NAN, but there may be other cases). is_instance_valid() is still required, since Freed Object causes an error in 4.0 in some cases, unlike null (passing a parameter, the is operator, is_instance_of(), etc).

null != false if I remember correctly.

Well, that would be actually correct as it is, but I should have been clearer that I mean this as a conversion to bool, in particular when using as a condition to if, not a straight equality comparison.
The NAN case is very specific. We could consider freed the same as NAN: a missing value that always fail comparison. But I believe that this is a bit too much and can get quite confusing. Also, currently what happens is: freed1 == freed2, so different freed objects are evaluated to be equal (also with is_same(freed1, freed2)). I think they can be equal if actually the same (unlike NAN), but not equal to a different one.
To be extra clear, I'm not proposing to remove is_instance_valid() either way.
I believe it is established that if null: does not run the block. Then should if freed: run the block or not? If freed == null is true then the block should not run. That is, the should have the same "truthyness" value.
Same applies to not null (currently true) which is one of the major things in this issue that motivates to fix it now. At the moment if freed: runs the block and if not freed: also runs the block. That is clearly wrong.
Now, we could make so freed != null while keeping if freed: to not run the block. This would make if freed: have different behavior than if freed == null:, which may be acceptable, but I also think it's confusing. I´d rather see users complaining that they are getting "freed object" errors than they complaining if freed: is different than if if freed == null: while the same as if null:

In the end, I think I'll go with if freed: to run the block (so "truthy") and also freed != null. It is the most clear IMO, without hiding details from the users even if they end up hitting issues more often. At least they will be aware and able to fix those (or work around them).

And then we just need to make sure in the documentation that if an object evaluates to true, but further down the line the code throws errors, then they need to use is_instance_valid() and more generally think about objects being freed somewhere else

Now, we could make so freed != null while keeping if freed: to not run the block. This would make if freed: have different behavior than if freed == null:, which may be acceptable, but I also think it's confusing.

0, 0.0, "", Color(), etc. are also not equal to null or false, but are implicitly cast to false in the if context.
I don't mind if Freed Object is booleaned to false for convenience, but not freed should obviously be true in this case.
Comparing a Freed Object to null is basically the wrong situation. I think hiding the error from the user here is a disservice. By making freed == null true, we only delay the moment the user realizes this, because in other situations there is still a difference between null and Freed Object.
It's sad that the user can shoot themselves in the foot by adding == null. If we want to prevent this, then the correct solution is to make the behavior the same as in 3.x IMO. That is, to make the error noticeable as early as possible. And recommend using is_instance_valid.

Reopening as #73896 is being reverted for now for 4.3.


refactor(app): migrate from craco to webpack for console assembly

Fix #455

E2E are still very flaky, we don't want to merge it until it becomes more stable.

Now it's become stable enough. Let me merge it.


⚠ Bofrost.nl has degraded performance

In 0521d12, Bofrost.nl (https://www.bofrost.nl) experienced degraded performance:

HTTP code: 200
Response time: 1424 ms

Resolved: Bofrost.nl performance has improved in 8f850f4.


How to trace non-ROS2 functions within ros2_tracing and view in tracecompass

I'm trying to run tracing for my ROS2 node. I was able to get the tracetools_analysis working and I can get the callback durations. I would also like to get further detail about my node. Could you answer the following questions? Thanks!

Does ros2_tracing support tracing my own non-ROS2 functions?

My ROS2 callbacks run different helper functions and I would like to see how long those functions within the callback take

Can I view the trace generated by ros2_tracing in a tool like tracecompass?

I'm hoping to see stuff like the flame graph with my helper functions, but currently tracecompass only has a list of events and event density
I also only see ROS2 specific functions

So far I've just used this launch file. Do I need to add tracepoints within my code or something like that?
import os
import launch
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node
from tracetools_launch.action import Trace

def generate_launch_description():
    """Generate launch description."""

    return launch.LaunchDescription(
            [
                Trace(
                    session_name='my_session',
                    events_kernel=['sched_switch'],
                ),
                Node(
                    package="my_package",
                    executable="my_executable",
                    name="some_name",
                )
            ]
        )

https://github.com/christophebedard/ros-world-2021-demo
https://gitlab.com/ros-tracing/ros2_tracing/-/raw/master/doc/2021-10-20_ROS_World_2021_-_Tracing_ROS_2_with_ros2_tracing.pdf

You can instrument your own code with LTTng and then use the ros2_tracing tools to enable the tracepoints (Trace action or ros2 trace command).
If you want to get a flame graph or flame chart for your functions, I'd recommend using gcc's function instrumentation feature (-finstrument-functions). This adds function calls at the start and end of the instrumented functions. gcc only allows you to instrument all functions and exclude individual functions or headers, so I'd recommend using this gcc plugin I've created in order to only instrument the individual functions you want: https://github.com/christophebedard/instrument-attribute-gcc-plugin
You can then use LTTng to trigger tracepoints inside the special functions that gcc adds: https://lttng.org/docs/v2.13/#doc-liblttng-ust-cyg-profile. You'll need to enable those special tracepoints (lttng_ust_cyg_profile*/lttng_ust_cyg_profile*:func_entry) like this: https://gitlab.com/ros-tracing/tracetools_analysis/-/blob/9c853b27fc380d763317ce786f0588007db8f33b/tracetools_analysis/launch/profile.launch.py#L29-L30. You alos need to LD_PRELOAD LTTng's liblttng-ust-cyg-profile.so library (or liblttng-ust-cyg-profile-fast.so), but the Trace action or ros2 trace command should do that for you.
Then you can import the trace into Trace Compass, and it should be able to display the information as a flame chart/graph, see https://archive.eclipse.org/tracecompass/doc/stable/org.eclipse.tracecompass.doc.user/LTTng-UST-Analyses.html#Flame_Chart_View.
I've written code to use trace data generated from the standard ROS 2 instrumentation in Trace Compass (like Figures 4 and 5 in this paper). You could then compare the flame charts of your functions to your subscription/timer callbacks, etc., e.g., by looking at the results side by side in Trace Compass. However, this is not all easily available yet. You could try to build Trace Compass yourself if you (really) wanted to, see: https://github.com/christophebedard/ros2-message-flow-analysis#analysis. Eventually you'll be able to download Trace Compass and install this feature, though.
Otherwise, if you create your own instrumentation, then you'll need to do the data analysis yourself (using tracetools_anlaysis or by writing a custom Trace Compass plugin). This is why I recommend going the -finstrument-functions way for your use-case here.
Hope that's useful. Let me know if you have any questions!

Thanks for the detailed reply Christophe! Looks really useful.
It will take me some time to familiarize myself with the tools and try this out. I'll let you know if I have any questions, but feel free to close this issue in the meantime.

Sounds good!


 这个描述亮了
你内存“爆炸”在Vscode执行什么阶段的什么操作时候啊？

Can you please provide the issue summary and description in English?

我也是，更新之后，一打开文件，我的 chrome 就会被干崩溃或者卡死

@CallMeR 我也遇到了，我反复尝试了好几次，都是在打开项目文件夹的时候，会有一个 Code Helper 经常占用的内存很高，我每次一打开文件夹，我的 chrome 就会收影响，真正播放视频的网页就会崩溃，有时候系统也会很卡。我用的是 MacBook pro ，系统版本 10.13.6 , vscode 版本是1.26.1

@sandy081
I had the same problem when I upgraded to version 1.26.1.
I've tried this many times, and whenever I open a project folder with it, there's a code helper process that takes up a lot of memory, which causes my chrome to crash and my system to slow down.

Does this happen with empty window or with a file opened?
Also please check if you can reproduce it by disabling all extensions?
And finally
Please follow this guide (https://github.com/Microsoft/vscode/wiki/Performance-Issues#visual-studio-code-starts-up-slowly) and attach the CPU profiles you get when starting with --prof-startup

VSCode Version: Code 1.26.1 (493869ee8e8a846b0855873886fc79d480d342de, 2018-08-16T18:34:20.517Z)
OS Version: Linux x64 4.14.65-1-MANJARO
CPUs: Intel(R) Pentium(R) CPU G2030 @ 3.00GHz (2 x 2977)
Memory (System): 7.69GB (1.29GB free)
Memory (Process): 198.70MB working set (230.81MB peak, 120.90MB private, 77.81MB shared)
Load (avg): 1, 1, 1
VM: 0%
Initial Startup: yes
Screen Reader: no
Empty Workspace: yes
Timings:

Component
Task
Time (ms)

main
start => app.isReady
56

main
app.isReady => window.loadUrl()
545

renderer
window.loadUrl() => begin to require(workbench.main.js)
243

renderer
require(workbench.main.js)
1569

renderer
create extension host => extensions onReady()
1149

renderer
restore viewlet
0

renderer
restore editor view state
1

renderer
overall workbench load
235

main + renderer
start => extensions ready
3598

main + renderer
start => workbench ready
2671

4c24-exthost.cpuprofile.txt
4c24-main.cpuprofile.txt
4c24-renderer.cpuprofile.txt

An other output,with my laptop,opened a txt file...

VSCode Version: Code 1.26.1 (493869ee8e8a846b0855873886fc79d480d342de, 2018-08-16T18:34:20.517Z)
OS Version: Linux x64 4.15.0-29deepin-generic
CPUs: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz (4 x 3397)
Memory (System): 7.48GB (5.63GB free)
Memory (Process): 232.43MB working set (241.46MB peak, 145.26MB private, 87.19MB shared)
Load (avg): 1, 0, 0
VM: 0%
Initial Startup: yes
Screen Reader: no
Empty Workspace: yes
Timings:

Component
Task
Time (ms)

main
start => app.isReady
48

main
app.isReady => window.loadUrl()
398

renderer
window.loadUrl() => begin to require(workbench.main.js)
265

renderer
require(workbench.main.js)
1336

renderer
create extension host => extensions onReady()
3284

renderer
restore viewlet
0

renderer
restore editor view state
734

renderer
overall workbench load
1010

main + renderer
start => extensions ready
5363

main + renderer
start => workbench ready
3078

3f4c-exthost.cpuprofile.txt
3f4c-main.cpuprofile.txt
3f4c-renderer.cpuprofile.txt

@CallMeR May I know what is the issue you are seeing? Is the start up slow or there is a crash or VS Code hangs?

@sandy081    When opened a folder which contents some other folder or files ，reopen vscode will be slow at startup.

@CallMeR Sorry not sure if I understand your scenario... Can you please provide a screencast which will be helpful to understand?


Add liveness probe

To determine if a given Contour instance is ready to receive traffic it would be helpful to have a liveness probe.

There are several duplicates of this issue already. Please review the open issues and close this one as a duplicate.

On 13 Mar 2018, at 19:45, Alvaro Aleman<EMAIL_ADDRESS>wrote:
To determine if a given Contour instance is ready to receive traffic it would be helpful to have a liveness probe.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


Handling A Repeated Form

Describe the feature
In digging through the formkit code while analyzing this issue I noticed that nodes are scoped globally in the registry. Let's say I had a page where I wanted to reuse a schema-based form definition to show the form at the top and again somewhere further down the page. It seems like the global registry (and use of getNode) would not support this unless I modified the IDs of each node in any additional instances of the form. But that's not very practical when trying to reuse a form definition.
This would be a breaking change, but perhaps the global registry should be scoped to the form id/instance? Alternatively, maybe some feature to add a prefix to the node IDs when initializing the root node would be useful.
Thanks.

The global registry would not support that. You can add prefixes to your ids if you choose, or make them dynamic. You can also use other utilities to get the node other than id like the node event or by traversing to any node from any other node by using name-based dot notation paths or arrays (node.at('location.street.city')).
It's unlikely that we'll change the way the registry is scoped, but I'm open to other utilities that help access nodes more conveniently.

you only overwrite the global registry if you use and id twice. We chose this attribute because it is already globally unique to the DOM. For example, getElementById uses a hashmap to reference DOM noes, and we are effectively doing the same thing.
The point about getNode is that it is not the only way to get the nodes just like getElementById is not the only way to get an Element. It just happens to be the globally unique method of doing so.
If you do want to go down the path you're suggesting of giving ever node a unique id (again, not totally necessary, but also totally fine to do if you want) you can do that fairly simply with an expression:
https://formkit.link/84e3ff2c7c002a5ab92fe9b41a82573e

👍


feat(vault): migrate gitlab token

What does this PR do?
Migrate gitlab token to vault
Motivation
ACIX-446 and #incident-31294
Describe how to test/QA your changes
Validate CI is green
Possible Drawbacks / Trade-offs
Additional Notes
Lint codeowners is failing and will be fixed by #29986

/merge


fix: remove deprecated templates module

fix for https://github.com/aws-ia/terraform-aws-polygon-technology-edge/issues/24

Thanks for the fix!


Is the example in "Performing streaming speech recognition on an audio stream" for local use only?

I am confused about this example:
https://cloud.google.com/speech-to-text/docs/streaming-recognize#performing_streaming_speech_recognition_on_an_audio_stream
How can I take this and create a let's say web app? Why is it node.js, but contains text like "Listening, press Ctrl+C to stop.", which makes it look like it could be used in a web app?
I guess my question is, is it possible to directly call google speech to text api from a web app without having my server? The example I provided seems to be doing that, but how would my service account be secured if make it a web app?

@dshukertjr the sample in context potentially clarifies a bit:
https://github.com/googleapis/nodejs-speech/blob/master/samples/recognize.js#L381
The sample code assumes you are running the application from command line, and uses the library node-record-lpcm16 to record from the mic and pipe it to the speech API.
To build a web application you would need to:

create a server that records an audio stream on the front-end:

https://www.html5rocks.com/en/tutorials/getusermedia/intro/

create a web-server, probably using a something like express, which accepts the audio stream and in turn streams it to the speech API.

You might also look at the auto-generated REST version of the speech API:
https://www.npmjs.com/package/googleapis
This library does expose a version of the speech API that should function in a front-end context.

Thank you for the clarification!


CI: Conformance E2E: no-unexpected-packet-drops/no-unexpected-packet-drops: No mapping for NAT masquerade

CI failure
Hit on https://github.com/cilium/cilium/pull/31539
Link: https://github.com/cilium/cilium/actions/runs/8553075421/job/23435496468
Entry: (6, 6.1-20240305.092417, none, true, {eth0,eth1}, vxlan, snat, true, true, testing-o...
Sysdump: cilium-sysdump-6-20240404-102953.zip
[=] Test [no-unexpected-packet-drops] [1/75]
...
  [-] Scenario [no-unexpected-packet-drops/no-unexpected-packet-drops]
  [.] Action [no-unexpected-packet-drops/no-unexpected-packet-drops/kind-kind/kind-worker]
  [.] Action [no-unexpected-packet-drops/no-unexpected-packet-drops/kind-kind/kind-worker2]
  [.] Action [no-unexpected-packet-drops/no-unexpected-packet-drops/kind-kind/kind-control-plane]
  ❌ Found unexpected packet drops:
{
  "labels": {
    "direction": "EGRESS",
    "reason": "No mapping for NAT masquerade"
  },
  "name": "cilium_drop_count_total",
  "value": 1
}

Related: https://github.com/cilium/cilium/issues/30139

I am getting this as well. Anything you found that can be useful?

Fixed by https://github.com/cilium/cilium/pull/34742


Update project to support Swift 2.3

Project should be updated to support Swift 2.3 with no source changes.

Should be resolved by #15.


[FEATURE REQUEST] Property macro: Don't create field for underscore prefixed properties

Sometimes there are properties that are derived from other values and not from the value of a field. In those cases, it doesn't make sense to create a struct field and it's also not always possible to define the type via the field since it might not implement Default
My current code
        #[property(override_interface = gtk::Scrollable, type = gtk::ScrollablePolicy, get = Self::scroll_policy, set = Self::set_ignore_scroll_policy)]
        pub(super) _hscroll_policy: (),

This would be more convenient but doesn't work since gtk::Scrollable does not implement Default
        #[property(override_interface = gtk::Scrollable, get = Self::scroll_policy, set = Self::set_ignore_scroll_policy)]
        pub(super) _hscroll_policy: gtk::Scrollable,

So maybe it's worth considering to not add the fields that are _ prefixed?

The Properties macro is a derive macro, so it can only derive/generate additional code, without altering the struct definition itself.
Any field defined in the struct is kept as is.
We cannot remove any field from the struct definition.
To define a field without any owned value you can use the type (), as you already did, or PhantomData<glib::Scrollable>. With PhantomData you can skip the type = glib::ScrollablePolicy attribute


flyctl: 0.0.475 -> 0.0.476

Description of changes
https://github.com/superfly/flyctl/releases/tag/v0.0.476
Things done

Built on platform(s)

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

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] 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
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
23.05 Release Notes (or backporting 22.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.

you forgot to commit the updated version attr

Ouch, sorry about this. Updated it.
Thanks!


Build issue

Build is not happening properly, always stuck with the typescript errors:

Also would be helpful if you can add multi stage docker file configuration, based on nextjs example.

Closing it, it was something to do with npm.


feat (GroupTheory/Congruence): add simp lemmas for comap equivalences

add a few lemmas, mostly about when the underlying types are equal, so too must be the quotient

Something's a bit messed up with this PR (the diff is 90k lines). Maybe merge master? Or if that doesn't work, ask on Zulip.

bors r-

Discussed with @jcommelin and approved so:
bors d+

Oh, it looks like my change wasn't yet applied. So we need to wait before merging until it is done. Is it okay if I push to your branch?
bors r-

@Vierkantor of course! thank you

Pushed and built so Let's Get This Merged!
bors r+


App settings lost when moving Drive Server

I'm not sure if what happened is a freak incident or a persistent issue, as I only encountered it once, but I think I should report it anyway.
I moved Drive Server and everything appeared to go fine with the script, the app did move to the other volume, but when I opened the admin console all the settings were gone. It had no team folder configured, the database showed 0 bytes used for versioning (should be several GB), clients had been forgotten, it was as if the app had just been installed for the first time.
Moving the app back to the original volume did not fix the issue, but restoring from Hyper Backup did.
After restoring from backup I tried again, but this time I moved the database to the new volume before running the script, and this time everything went smoothly. No idea if that's the reason or if it's just a coincidence.
This was moving from an ext4 volume to btrfs. All other apps moved without issue. DSM 7.2.1.

I will try restoring with Hyperbackup but all my applications except Driver Server migrated correctly. I am on 7.2.2.

"If you are moving Synology Drive it appears you need to move the synology drives database from with in the Drive admin console before moving any files for the application from one volume to another."

@bglf83 Did you move the synology drives database from with in the Drive admin console before using the script to move the Synology Drive package?
I'll do some experiments.

I appreciate the work for Synology Drive. I just ended up resetting it up fully. Everything else worked great.


Remove broken links from the website

Hi,
I found at least 2 broken links in the how to section.
I switch one to the archived version of the article and removed the second as it was never archived.

@jeansebastienh Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@jeansebastienh Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.

@jeansebastienh Thank you for signing the Contributor License Agreement!

@jeansebastienh Thank you for signing the Contributor License Agreement!

Thank you. That entire page is very old and probably needs to be replaced or removed. We can start here.

Thank you. That entire page is very old and probably needs to be replaced or removed. We can start here.


Document DELETE limitation: errors when there are self-referencing FKs

For details, see #25809.
Probable scope of work:

Update DELETE page
Update Known Limitations page(s)
Update Foreign keys page

Need to test whether this affects all 2.x versions.

Closing as out of date


libp2p-0.5.0

This PR tracks libp2p/master until the next release, incorporating the necessary changes into Substrate. So far that includes:

The generalization from SecioKeyPairs to libp2p_core::identity::Keypairs (https://github.com/libp2p/rust-libp2p/pull/972).
Changes to the connection shutdown process. (https://github.com/libp2p/rust-libp2p/pull/992).

Additionally, as part of the changes necessary for 1., it includes two fully backward-compatible enhancements to the node key management:

Support for Ed25519 keys, addressing https://github.com/paritytech/substrate/issues/1494. This is achieved via a new CLI option --node-key-type, which defaults to secp256k1 for backward compatibility, i..e to allow a graceful transition period. I understand that ed25519 is the preferable default and added a note to the effect that the default will change in a future release to the --help CLI text. That note should probably also go into the release notes of Substrate, but I didn't find any.

Support for loading node keys from (external) files, via a new CLI option --node-key-file. This is useful in particular because passing externally-managed secrets as command-line arguments (--node-key) is not really a good idea for production deployments, for which I also added a warning in the CLI help for --node-key.

This PR is marked as a WIP because the next libp2p release that includes the above changes (0.5?) has not yet been cut. It can nevertheless already be reviewed, however.
cc @tomaka

When it comes to the secret file, I think we should only ever have one secret file that contains some JSON data structure indicating both the key and its type.
And if the file happens to be 32 bytes long, we try to interpret it as a secp256k1 key instead of JSON, for backwards compatibility.

If we keep --node-key, I'd say that we need the --node-key-type option to specific its type. However it's probably indeed a good idea to deprecate --node-key, and therefore --node-key-type wouldn't be needed.

When it comes to the secret file, I think we should only ever have one secret file that contains some JSON data structure indicating both the key and its type.
And if the file happens to be 32 bytes long, we try to interpret it as a secp256k1 key instead of JSON, for backwards compatibility. Bonus points if we rewrite the secret file with the new format when we detect that.

That was one of the first approaches I considered, since you mentioned it in the linked issue. However, some of the reasons why I chose the solution presented here are as follows:

It does not require temporary code for a rather hacky in-place migration.

It allows to easily switch between different keys by just changing the --node-key-type argument, and in particular an easy rollback to the previously used key in case of unforeseen issues.

It does not force all types of keys, of current or future types, into the straight-jacket of JSON, requiring additional text encoding of binary data. Different key types can have different preferred binary formats, some mere conventions and some standardised (PKCS-whatever ASN.1 DER etc.). Always having to wrap these up in a Substrate-specific JSON file is awkward and less interoperable with other programs and tools.

If we keep --node-key, I'd say that we need the --node-key-type option to specific its type. However it's probably indeed a good idea to deprecate --node-key, and therefore --node-key-type wouldn't be needed.

How would you then say for a new node "I want to use node keys of type xyz, generated and managed / stored per-chain by Substrate"? With the current approach, you just specify --node-key-type=xyz (or nothing at all, if xyz is the default key type) and Substrate will generate a key of that type in BASE_DIR/mychain/network/secret_xyz. The purpose of --node-key-file is as a better alternative to --node-key, i.e. both are for using externally-managed secret keys that may neither be generated nor stored by Substrate (unless you point --node-key-file into the chain-specific substrate network config directory, of course, in which case that is pretty much equivalent to not setting --node-key-file at all).

I understand better why you went this way now.
The reason why I had the JSON in mind is that we actually don't really want flexibility of the key type, as flexibility is more and more seen as an anti-pattern. What we want is rather a smooth transition from secp256k1 keys to ed25519 keys, and then leave the door open for possible other migrations if deemed necessary. However the target is really ed25519, so that we can use noise as the encryption negotiation layer.
However I don't actually have a strong opinion on that. The target is noise, but the way to achieve it is not totally clear to me.

flexibility is more and more seen as an anti-pattern

in extremis, sure. You have to go quite far down that road for it to become so costly that it's not worth it though.

[..] What we want is rather a smooth transition from secp256k1 keys to ed25519 keys, and then leave the door open for possible other migrations if deemed necessary. However the target is really ed25519, so that we can use noise as the encryption negotiation layer.

As you say, even if substrate effectively only ever wants to offer a single type of keys for use with libp2p and hence the option for secp keys is eventually removed, it is important to always have an upgrade path that at least temporarily permits multiple types of keys and easy rollback / switching between keys - after all, a change of keys is a  key rotation where there needs to be a window where both old and new keys are still supported. I think that is what the approach taken here can help with. --node-key could certainly be deprecated and removed later, if desired.
As for the transition to ed25519 / noise, I don't think there are too many options, i.e. wouldn't it necessarily have to go something like this:

A release that adds support for ed25519 keys and a deprecation notice for secp keys (e.g. via this PR). Supported keys in this release: secp256k1, ed25519 ; Supported encryption protocols in this release: secio.

A release that adds noise as a preferred alternative to secio into the network configuration if the node's key type is ed25519. Supported keys in this release: secp256k1, ed25519 ; Supported encryption protocols in this release: secio, noise. At this point, the security level would of course still be that of secio and secp, since (if I understand correctly) the multistream-select negotiation can easily be tampered with until an authenticated, encrypted channel is established.

A release that removes support for secio and secp keys at the same time, since without secio, secp keys are of no use. At the time of this release, any release prior to 2. would already have to be considered unsupported / phased out, so the timing also depends on how long old releases are supposed to be supported.

Thereby 1. and 2. could happen in the same release, but any upgrade path must include a period where both types of keys and encryption protocols are supported, or do you see other options?

Thereby 1. and 2. could happen in the same release, but any upgrade path must include a period where both types of keys and encryption protocols are supported, or do you see other options?

No, that's what I had in mind.

while we're on the subject of keys, it'd be great if libp2p exposed enough API for us to derive a key using substrate's Ed25519 lib and pass the secret into libp2p as the node key.

while we're on the subject of keys, it'd be great if libp2p exposed enough API for us to derive a key using substrate's Ed25519 lib and pass the secret into libp2p as the node key.

From a first look (and if I understand correctly) then that shouldn't be difficult, since the ed25519::Pair from substrate-primitives already keeps the secret seed, which actually corresponds to what a libp2p_core::identity::ed25519::SecretKey actually is (it uses ed25519-dalek under the covers where the secret key is just the secret seed bytes which get "expanded" only for signing, whereas the underlying secret key in ring used by ed25519::Pair that is not exposed corresponds to ed25519_dalek::ExpandedSecretKey). So something like the following should work in the context of this PR:
let substrate_ed25519_pair = ...
let libp2p_ed25519_sk = libp2p_core::identity::ed25519::SecretKey::from_bytes(&mut substrate_ed25519_pair.seed().clone()).unwrap();
let libp2p_key_config = NodeKeyConfig::Ed25519(Secret::Input(libp2p_ed25519_sk));
let libp2p_identity = libp2p_key_config.into_keypair():
...

I'm not sure why the runtime has changed though.

Could you rebase/merge so that we merge this?
You can probably just remove the WASM runtime files from the PR.

Sure, will do so shortly.


Makefile: Start etcd test container with -listen-peer-urls

Without this parameter, the default etcd container could potentially
attempt to resolve a localhost address and bind to that even though
there are no local interfaces with the address, leading to the etcd
container exiting on startup. This would prevent the unit-tests from
running in some environments.
Fixes: #3920

test-me-please

Test previously passed, fixed review comments, suggesting that we just merge this as the change was just tab->whitespace.


Add Elementum P2P Engine

Elementum fork of Quasar

Fix included in play-to-kodi Addon for Firefox version 1.9.2beta4

Change string version to  "version": "<IP_ADDRESS>",

@Nemiroff
I and thanks, if i do that i can install the extension, and setup (configure) the extension. Then i have two extension "play to kodi" (the extension that I had already configured with Quasar and the one I just installed (configured with Elementum).
If I go to YouTube, I can play the video, but if I go to a page with torrents, I have the option play to kodi, from the old extension.
If I uninstall the old version, I find that in the contextual menu I only see "show image" (and not "play to kodi" ...)
What could I do?
Thank you very much.


pass BRANCH_NAME to export-git-env-vars script properly

Another slight adjustment for HEAD issue which is hard to track but easy to patch post mortem

!ci-build-me

!ci-nightly-me


Connection URI does not support the read preferences and write concern options

ReactiveMongo driver doesn't support the read preferences and write concern options in connection uri.
It would be nice to follow the documentation on 10gen regarding connection string format:
http://docs.mongodb.org/manual/reference/connection-string/
api.scala MongoConnection
    def makeOptions(opts: Map[String, String]): (List[String], MongoConnectionOptions) = {
      opts.iterator.foldLeft(List.empty[String] -> MongoConnectionOptions()) { case ((unsupportedKeys, result), kv) =>
        kv match {
          case ("authSource", v)           => unsupportedKeys -> result.copy(authSource = Some(v))
          case ("connectTimeoutMS", v)     => unsupportedKeys -> result.copy(connectTimeoutMS = v.toInt)

          case ("rm.tcpNoDelay", v)        => unsupportedKeys -> result.copy(tcpNoDelay = v.toBoolean)
          case ("rm.keepAlive", v)         => unsupportedKeys -> result.copy(keepAlive = v.toBoolean)
          case ("rm.nbChannelsPerNode", v) => unsupportedKeys -> result.copy(nbChannelsPerNode = v.toInt    )

          case (k, _) => (k :: unsupportedKeys) -> result
        }
      }
    }

Looks like write concern and journal options are completely missing: http://reactivemongo.org/releases/0.10.5/api/index.html#reactivemongo.api.MongoConnectionOptions
Is this intentional?
Is there a workaround to specify write concern and journal and other options when connecting to mongodb?

The read preference & write concern are managed per-call (not as global connection option), on collection functions: http://reactivemongo.org/releases/0.10.5/api/index.html#reactivemongo.api.collections.GenericCollection .
Please first ask such question on the Mailing list.
Best regards


Fixes Auth URL presenter:

kinda works on iOS 8-;
calls back with cancellation error correctly on 'Done' button;
cleans up upon completion.

Updated unit tests.


refactor the PCHIP interpolant's algorithm

Apparently, scipy's implementation of PCHIP interpolator was different from either Matlab or NAG or generally what's recommended in the literature. (specifically, the way internal slopes were set was slightly different from what's generally recommended).
Additionally, the end slopes were selected in a suboptimal way, which produced artefacts in some cases. Fix this as well.
closes gh-5326, closes gh-3453
While I'm at it, improve the docstring a bit for layout and references.

Thanks, looks good to me.


Latency placeholders do not work with any directive

1. What version of Caddy are you using (caddy -version)?
0.10.6
2. What are you trying to do?
Add server latency to http headers
3. What is your entire Caddyfile?
example.com {
        root /path/to/public/
        tls<EMAIL_ADDRESS>        fastcgi / unix:/run/php-fpm/php-fpm.sock php
        rewrite {
                to {path} {path}/ /index.php?{query}
        }
        gzip
        expires {
                match .(ico|pdf|jpg|jpeg|png|gif|svg|css|js|ttf|eot|woff)$ 1y
        }
        errors /var/log/caddy/errors.log {
                rotate_size 50
                rotate_age  90
                rotate_keep 20
        }
        push
        header / +x-server-latency {latency_ms}
}

4.  Please paste any relevant HTTP request(s) here.
curl --head
6. What did you expect to see?
cache-control: no-cache, private
content-type: text/html; charset=UTF-8
date: Wed, 16 Aug 2017 14:09:17 GMT
server: Caddy
x-powered-by: PHP/7.1.8
x-server-latency: 100ms
7. What did you see instead (give full error messages and/or log)?
cache-control: no-cache, private
content-type: text/html; charset=UTF-8
date: Wed, 16 Aug 2017 14:09:17 GMT
server: Caddy
x-powered-by: PHP/7.1.8
x-server-latency:
8. How can someone who is starting from scratch reproduce the bug as minimally as possible?
As per https://caddyserver.com/docs/fastcgi and https://caddyserver.com/docs/placeholders it is not clear which directives support the latency placeholders.

Thanks for the detailed issue report.  You specify fast-cgi as the issue.  Does the {latency_ms} placeholder work when the fastcgi directive is not used?

Can confirm it does not work when only serving plain files. Changing x-server-latency to latency does not fix the problem.

The latency placeholders are response placeholders, and directives which support them do mention that in the docs (for example the log directive supports response placeholders) - the header directive does not.


Transmitter not picking up consecutive audios from AudioPlayer

I've recently noticed that if I let an AudioPlayer (disc) song finish and I try to play another one after it, it will not be picked up.
Order I've tried:
Insert Disc > Let Song Play > Eject Disc > Talk a little (it gets picked up and transmitted) > Insert New Disc (Doesn't get transmitted at all)
I've also found out that the only way to have the second disc play is if I turn the Transmitter off and on again between them which can get pretty stressful and annoying.
Thank you for any help!

Interesting, I thought this issue was already fixed in the latest version. Does this happen with the latest version of the mod?

Yes, I was using version 1.2.2 on Minecraft 1.21

Also worth mentioning: If I start playing a disc and I eject it mid-song, it keeps playing on receivers untill I turn the transmitter off.

I'm really sorry to throw so many issues at you but I found something else q-q
For some reason only one receiver can hear voice transmitted at a time. Radios work just fine but receivers, only one can output voice if multiple are tuned into the same frequency. Music works just fine just not speach. I'll investigate more in the morning as I think this is probably something on my side as I don't think it could have slipped through testing but it would still mean a lot if you could prove this.
I really hope these bug reports are helping the mod grow and aren't annoying. I value your time and effort.