From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from mail-ua0-x230.google.com (mail-ua0-x230.google.com [IPv6:2607:f8b0:400c:c08::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E87A31F404; Tue, 23 Jan 2018 21:05:18 +0000 (UTC) Received: by mail-ua0-x230.google.com with SMTP id x10so1319397ual.8; Tue, 23 Jan 2018 13:05:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=k0S254pNPfh1h2ZlR9+5qJv9w/fmZILOuOVL9IAsLW4=; b=p7svEuhDpM4/GyPLuZVzTQ5wv5nwOAYdkxgxFs8qNNQOT0CiznDdu4ZzIIibtJ62SG Mo8kx8alRFbXqr1FeUwEb/Uc8ggj52PdkQYyUFAf1NKTRz0qooHq2XIOiBj4YVFL+JRv 7X1sEAotsBTW+Bfz4ZnHX7u4lQgakekVlNQcK+mu8xmWLBMWjbOeaWA3+0xX89njf3Z2 3fnKn+xTNyFYI+P6NnPsV1hHqfVWBKNUvJ/TZ+T6+7sL48dfcq9mVS+b+4LU/yeFo51r GQUm93xqNPjmoEXkvTBXcvk2bZ1FHbf2rjztUT0ZplkNeTLoZTNN++VWEMknlEPGX+hJ Ermg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=k0S254pNPfh1h2ZlR9+5qJv9w/fmZILOuOVL9IAsLW4=; b=SsvJWxse1IbErIK/urTvzRg1l33sonp20CQjlvzTdoYIqQ6W06UsDUVvKRmAFgjLrR JYdlGpazIPT9T+r9gFfYbUsHMtNgUj2CebtW150jxpZwDsHDeZbEa68MaTtMGQ5eVzEb 2YiTd8fvsbTYCgseDKxkBi8m2Y5MgNrSrzusEYkdy/JtMzRQK7ClWAC/+yTGvP7qGur7 RO1ljv3Qdb93a574HYEQ0zDENO78vPvYzn3S+pV1rFQ/Lfdru8KO+ASA6R0sVcLPl2/B vHiWTO6d88URjLKLvxE96Tb/OmrPML5aqc5hljqfVF9UJ6e+ZSSnjh/KFLQjV+9aLyFA Y9kw== X-Gm-Message-State: AKwxytc50MvuPau+8PcIZJ+Z35Dx/30e6kKsHJcBzPBRi3dUTYUbwpV8 8JTZaQ77JQTlWds5HumJ08AyrGwGuef9k+Uwh5BneA== X-Google-Smtp-Source: AH8x225IRfNZ8WLGdBx4CjyFZXUtOz5ilOGIMzM9/qi6bEp6SBw4Vjcp94rHsboxOgHWTB3xy6L3VvqJ0UDjuzSBlKc= X-Received: by 10.159.53.168 with SMTP id t37mr2851639uad.133.1516741517771; Tue, 23 Jan 2018 13:05:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.21.2 with HTTP; Tue, 23 Jan 2018 13:04:37 -0800 (PST) In-Reply-To: <20180121234911.GA29238@whir> References: <20180121234911.GA29238@whir> From: Dimid Duchovny Date: Tue, 23 Jan 2018 23:04:37 +0200 Message-ID: Subject: Re: Feature Request: thread grouping To: Eric Wong Cc: msgthr-public Content-Type: text/plain; charset="UTF-8" List-Id: 2018-01-22 1:49 GMT+02:00 Eric Wong : > Dimid Duchovny wrote: >> However, I realized that the last step (walking) is redundant, >> since that could be done by the library itself in the threading or >> ordering stages. > > I think you want is best done in the storage/indexing stage; > whereas msgthr is intended for display/rendering results that > were retrieved from some sort of search engine. > You're right. In my case the flow was: read emails from storage -> group to threads -> add thread field to storage. However, I guess it's an edge-case. On second thought, maybe it'd be better to have a more general solution. E.g. let the client run an arbitrary callback after adding a child. Here's a quick POC: https://github.com/dimidd/msgthr/commit/1c701717d10879d492d8b55fb8ca2f1c53d7e13f P.S. I hope you don't mind I uploaded my fork to github.